Fix except statement

Signed-off-by: fly <merspieler@airmail.cc>
This commit is contained in:
fly 2021-06-18 22:29:21 +00:00
parent 75ff8d8ba1
commit df47729b1a

View file

@ -138,7 +138,7 @@ def api_send_status(name, status, api, token):
else: else:
print("Warning: Unable to send status '" + status + "' for tile '" + name + "'. Trying again in 60 seconds") print("Warning: Unable to send status '" + status + "' for tile '" + name + "'. Trying again in 60 seconds")
sleep(60) sleep(60)
except (ConnectionError, OSError, IOError, json.decoder.JSONDecodeError): except (ConnectionError, OSError, IOError, json.JSONDecodeError):
print("Warning: Unable to send status " + status + " for tile " + name + ". Trying again in 60 seconds") print("Warning: Unable to send status " + status + " for tile " + name + ". Trying again in 60 seconds")
sleep(60) sleep(60)
@ -191,7 +191,7 @@ def api_get_job(action, new_status, api, token, none_exit=True, all_in_parent=0)
sleep(60) sleep(60)
ret = api_get_job(action, new_status, api, token, none_exit, all_in_parent) ret = api_get_job(action, new_status, api, token, none_exit, all_in_parent)
return ret return ret
except (ConnectionError, OSError, IOError, json.decoder.JSONDecodeError): except (ConnectionError, OSError, IOError, json.JSONDecodeError):
print("Unable to get job. Retrying in 60 seconds...") print("Unable to get job. Retrying in 60 seconds...")
sleep(60) sleep(60)
ret = api_get_job(action, new_status, api, token, none_exit, all_in_parent) ret = api_get_job(action, new_status, api, token, none_exit, all_in_parent)
@ -234,6 +234,6 @@ def api_get_status(name, api, api_token):
else: else:
print("ERROR: Unable to get status.") print("ERROR: Unable to get status.")
sys.exit(1) sys.exit(1)
except (ConnectionError, OSError, IOError, json.decoder.JSONDecodeError): except (ConnectionError, OSError, IOError, json.JSONDecodeError):
print("ERROR: Unable to get status.") print("ERROR: Unable to get status.")
sys.exit(1) sys.exit(1)