From e9989cfbd661a816ce1dded3ff7e6c1864f37f82 Mon Sep 17 00:00:00 2001 From: "Scott C. Livingston" Date: Mon, 2 Sep 2024 16:31:13 -0700 Subject: [PATCH] lint --- rerobots/api.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/rerobots/api.py b/rerobots/api.py index d31761f..cc2fea7 100644 --- a/rerobots/api.py +++ b/rerobots/api.py @@ -245,7 +245,7 @@ def get_access_rules(self, wdeployment_id=None, to_user=None): else: try: payload = res.json() - except: + except requests.exceptions.JSONDecodeError: raise Error(res.text) if 'error_message' in payload: if payload['error_message'] == 'wrong authorization token': @@ -310,7 +310,7 @@ def get_instances(self, include_terminated=False, page=None, max_per_page=None): else: try: payload = res.json() - except: + except requests.exceptions.JSONDecodeError: raise Error(res.text) if 'error_message' in payload: if payload['error_message'] == 'wrong authorization token': @@ -337,7 +337,7 @@ def get_instance_info(self, instance_id): else: try: payload = res.json() - except: + except requests.exceptions.JSONDecodeError: raise Error(res.text) if 'error_message' in payload: if payload['error_message'] == 'instance not found': @@ -358,7 +358,7 @@ def terminate_instance(self, instance_id): if not res.ok: try: payload = res.json() - except: + except requests.exceptions.JSONDecodeError: raise Error(res.text) if 'result_message' in payload: errmsg = payload['result_message'] @@ -414,7 +414,7 @@ def request_instance( else: try: payload = res.json() - except: + except requests.exceptions.JSONDecodeError: raise Error('Response {}: {}'.format(res.status_code, res.content)) errmsg = payload.get('result_message', None) if errmsg is None: @@ -831,7 +831,7 @@ def get_ci_projects(self): else: try: payload = res.json() - except: + except requests.exceptions.JSONDecodeError: raise Error(res.text) if 'error_message' in payload: if payload['error_message'] == 'wrong authorization token': @@ -856,7 +856,7 @@ def create_ci_project(self, repo_url): else: try: payload = res.json() - except: + except requests.exceptions.JSONDecodeError: raise Error(res.text) if 'error_message' in payload: if payload['error_message'] == 'wrong authorization token': @@ -883,7 +883,7 @@ def submit_ci_job(self, pid, branch, ref): raise Error('not found') try: payload = res.json() - except: + except requests.exceptions.JSONDecodeError: raise Error(res.text) if 'error_message' in payload: if payload['error_message'] == 'wrong authorization token':