Skip to content

Commit

Permalink
fix: Include raw body in ApiError messages
Browse files Browse the repository at this point in the history
  • Loading branch information
benjamb authored and barthalion committed Aug 28, 2024
1 parent 815ff3a commit 51090f0
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion flat-manager-client
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,11 @@ class ApiError(Exception):
try:
self.body = json.loads(body)
except (json.JSONDecodeError, TypeError):
self.body = {"status": self.status, "error-type": "no-error", "message": "No json error details from server"}
self.body = {
"status": self.status,
"error-type": "no-error",
"message": f"Non-json error from server: {body}",
}

def repr(self):
return {
Expand Down

0 comments on commit 51090f0

Please sign in to comment.