Skip to content

Commit

Permalink
Convert bare except to exceptions raised by json.loads()
Browse files Browse the repository at this point in the history
  • Loading branch information
benjamb committed Aug 28, 2024
1 parent 32c7b60 commit b42ede7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion flat-manager-client
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ class ApiError(Exception):

try:
self.body = json.loads(body)
except:
except (json.JSONDecodeError, TypeError):
self.body = {"status": self.status, "error-type": "no-error", "message": "No json error details from server"}

def repr(self):
Expand Down

0 comments on commit b42ede7

Please sign in to comment.