From 2538c7c8a1f6fdd36e9d7c6a12395bd93046d94d Mon Sep 17 00:00:00 2001 From: freaker2112 Date: Mon, 6 Jan 2025 08:45:15 -0600 Subject: [PATCH] added end on error logic to api calls --- autocalc.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/autocalc.py b/autocalc.py index fa70f68..4cf77ff 100644 --- a/autocalc.py +++ b/autocalc.py @@ -31,6 +31,7 @@ with tbaapiv3client.ApiClient(configuration) as api_client: #print(api_response) except ApiException as e: print("Exception when calling EventApi->get_team_events_by_year_simple: %s\n" % e) + quit() relevant_events = [event for event in api_response if event.event_type == 0] @@ -47,6 +48,7 @@ with tbaapiv3client.ApiClient(configuration) as api_client: #pprint(event_api_response1) except ApiException as e: print("Exception when calling EventApi->get_event: %s\n" % e) + quit() with tbaapiv3client.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = tbaapiv3client.EventApi(api_client) @@ -55,6 +57,7 @@ with tbaapiv3client.ApiClient(configuration) as api_client: #pprint(event_api_response2) except ApiException as e: print("Exception when calling EventApi->get_event: %s\n" % e) + quit()