From dafcfc64648443767773a00058af4ceb8e01866d Mon Sep 17 00:00:00 2001 From: fly Date: Sat, 13 Mar 2021 21:30:03 +0000 Subject: [PATCH] More bug fixes Signed-off-by: fly --- common.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/common.py b/common.py index 330bc9f..9bafe86 100644 --- a/common.py +++ b/common.py @@ -129,7 +129,7 @@ def api_send_status(name, status, api, token): else: print("Warning: Unable to send status '" + status + "' for tile '" + name + "'. Trying again in 60 seconds") sleep(60) - except ConnectionError: + except (ConnectionError, ProtocolError, OSError, IOError): print("Warning: Unable to send status " + status + " for tile " + name + ". Trying again in 60 seconds") sleep(60) @@ -179,7 +179,8 @@ def api_get_job(action, api, token, none_exit=True): print("Unable to get job. Retrying in 60 seconds...") sleep(60) ret = api_get_job(action, api, token, none_exit) - except ConnectionError: + return ret + except (ConnectionError, ProtocolError, OSError, IOError): print("Unable to get job. Retrying in 60 seconds...") sleep(60) ret = api_get_job(action, api, token, none_exit) @@ -222,6 +223,6 @@ def api_get_status(name, api, api_token): else: print("ERROR: Unable to get status.") sys.exit(1) - except ConnectionError: + except (ConnectionError, ProtocolError, OSError, IOError): print("ERROR: Unable to get status.") sys.exit(1)