Код: Выделить всё
print("gather data")
try:
snow_response = requests.request("GET", SOME_URL, auth = snow_auth)
snow_response.raise_for_status()
snow_all_applications = json.loads(snow_response.text)["result"]
except (ConnectionAbortedError,ConnectionError,ConnectionRefusedError,TimeoutError,ConnectionResetError) as error:
print(error)
sys.exit()
except Exception as error:
print(f"Other exception occured. status code: {snow_response.status_code}")
print(error)
sys.exit()
https://pastebin.com/U9sBT3bQ
По последним строкам мы ясно видим, что первый блок исключений игнорируется.
Я этого не понимаю, потому что возникает ConnectionError (строка 62)
Лучший
Подробнее здесь: https://stackoverflow.com/questions/786 ... cept-block