From 100f6e1c93b174b382cfdba71092c7a380e78a2d Mon Sep 17 00:00:00 2001 From: Ben Brown Date: Wed, 28 Aug 2024 10:38:44 +0100 Subject: [PATCH] fix: Convert bare except to exceptions raised by json.loads() --- flat-manager-client | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/flat-manager-client b/flat-manager-client index 06cde79..c45d4b6 100755 --- a/flat-manager-client +++ b/flat-manager-client @@ -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): @@ -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: