From a83052af49b904fccb82b40e011356776bbd600a Mon Sep 17 00:00:00 2001 From: Jxck-S Date: Sun, 4 Oct 2020 19:36:39 -0400 Subject: [PATCH] Move HTTP code out of try --- defADSBX.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/defADSBX.py b/defADSBX.py index e9c6d83..1581ecf 100644 --- a/defADSBX.py +++ b/defADSBX.py @@ -20,7 +20,6 @@ def pullADSBX(planes): response = requests.get(url, headers = headers) data = response.text data = json.loads(data) - print ("HTTP Status Code:", response.status_code) failed = False except (requests.HTTPError, requests.ConnectionError, requests.Timeout, IncompleteRead) as error_message: print("ADSBX Connection Error") @@ -31,6 +30,7 @@ def pullADSBX(planes): print (json.dumps(data, indent = 2)) print(error_message) failed = True + print ("HTTP Status Code:", response.status_code) if failed is False: data_ctime = float(data['ctime']) / 1000.0 print("UTC of Data:",datetime.utcfromtimestamp(data_ctime))