Skip to content

Commit

Permalink
fix: Convert bare except to exceptions raised by json.loads()
Browse files Browse the repository at this point in the history
  • Loading branch information
benjamb authored and barthalion committed Aug 28, 2024
1 parent 32c7b60 commit 815ff3a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions 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 Expand Up @@ -581,7 +581,7 @@ async def publish_build(session, build_url, wait, token):
elif current_state == "validating":
print("the build is still being validated or held for review")
return {}
except:
except json.JSONDecodeError:
pass

if resp.status != 200:
Expand Down

0 comments on commit 815ff3a

Please sign in to comment.