From c3289c20472621b22397f8351184325bb0f4ef0d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=85smund=20V=C3=A5ge=20Fannemel?= <34712686+asmfstatoil@users.noreply.github.com> Date: Thu, 20 Aug 2026 00:03:11 +0200 Subject: [PATCH] fix: simplify missing auth for AspenOne and broaden exception handling in get_handler --- tagreader/clients.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/tagreader/clients.py b/tagreader/clients.py index 4abc9a3..fe477cd 100644 --- a/tagreader/clients.py +++ b/tagreader/clients.py @@ -50,8 +50,6 @@ def list_sources( auth = get_auth_pi() return list_piwebapi_sources(url=url, auth=auth, verify_ssl=verify_ssl) elif imstype == IMSType.ASPENONE: - if auth is None: - auth = get_auth_aspen() return list_aspenone_sources(url=url, auth=auth, verify_ssl=verify_ssl) elif imstype in [IMSType.PI, IMSType.ASPEN, IMSType.IP21]: raise ValueError( @@ -132,7 +130,7 @@ def get_handler( aspen_source = list_aspenone_sources( url=None, auth=None, verify_ssl=verify_ssl ) - except requests.exceptions.HTTPError: + except (requests.exceptions.HTTPError, requests.exceptions.ConnectionError): # Try again using app registration auth try: auth = get_auth_aspen(False)