Skip to content

Commit

Permalink
Add simple error checking in httpjson
Browse files Browse the repository at this point in the history
  • Loading branch information
ekouts committed Dec 20, 2024
1 parent 1829064 commit 6028f1c
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion reframe/core/logging.py
Original file line number Diff line number Diff line change
Expand Up @@ -689,10 +689,15 @@ def emit(self, record):
return

try:
requests.post(
response = requests.post(
self._url, data=json_record,
headers=self._headers
)
if response.status_code != 200:
raise LoggingError(
f'logging failed: HTTP response code '
f'{response.status_code}'
)
except requests.exceptions.RequestException as e:
raise LoggingError('logging failed') from e

Expand Down

0 comments on commit 6028f1c

Please sign in to comment.