Skip to content

Commit

Permalink
Add the http status also to the error message
Browse files Browse the repository at this point in the history
Getting the http status code allows to determine the root cause more
easily.
  • Loading branch information
bjoernricks committed Jul 6, 2023
1 parent d2667b1 commit 4971998
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pontos/github/script/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,9 @@ def main():
error = e.response.json()
message = error.get("message")
print(
f"HTTP error while running script {known_args.script} and "
f"doing a {e.request.method} request to {e.request.url}. "
f"Error was: {message}. ",
f"Got HTTP status {e.response.status_code} while running "
f"script {known_args.script} and doing a {e.request.method} "
f"request to {e.request.url}. Error was: {message}. ",
file=sys.stderr,
)
except json.JSONDecodeError:
Expand Down

0 comments on commit 4971998

Please sign in to comment.