Skip to content

Commit

Permalink
[requests] improve server error message / stacktrace
Browse files Browse the repository at this point in the history
  • Loading branch information
EvanBldy committed Nov 14, 2024
1 parent e70ff37 commit 4d8bd37
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions gazu/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -384,15 +384,15 @@ def check_status(request, path, client=None):
raise
elif status_code in [500, 502]:
try:
print("A server error occured!\n")
stacktrace = request.json().get(
"stacktrace", "No stacktrace sent by the server"
)
print("Server stacktrace:\n%s" % stacktrace)
message = get_message_from_response(
response=request,
default_message="No message sent by the server",
)
print("A server error occured!\n")
print("Server stacktrace:\n%s" % stacktrace)
print("Error message:\n%s\n" % message)
except Exception:
print(request.text)
Expand Down

0 comments on commit 4d8bd37

Please sign in to comment.