From 79a5dcdef2ef3929f764413938f9067a74535415 Mon Sep 17 00:00:00 2001 From: Sven Hoexter Date: Fri, 27 Aug 2021 13:30:19 +0200 Subject: [PATCH] simplify exception to one try block --- home/portalmonitor.py | 6 ------ 1 file changed, 6 deletions(-) diff --git a/home/portalmonitor.py b/home/portalmonitor.py index 12a088e..2264206 100755 --- a/home/portalmonitor.py +++ b/home/portalmonitor.py @@ -46,10 +46,7 @@ def getCurrentPower(userName, password, stationId): 'pwd': password }, timeout=(10, 30)) - except requests.exceptions.RequestException as e: - raise SystemExit(e) - try: r = s.post( 'https://www.envertecportal.com/ApiStations/getStationInfo', data={ @@ -57,10 +54,7 @@ def getCurrentPower(userName, password, stationId): }, timeout=(10, 60)).json() power = r['Data']['Power'] - except requests.exceptions.RequestException as e: - raise SystemExit(e) - try: r = s.post('https://www.envertecportal.com/apiAccount/Logout', timeout=(10, 30)) except requests.exceptions.RequestException as e: -- 2.39.5