Skip to content

Commit

Permalink
Do not log an error on token refresh in bytes client (#2469)
Browse files Browse the repository at this point in the history
Co-authored-by: Jan Klopper <[email protected]>
  • Loading branch information
dekkers and underdarknl authored Feb 11, 2024
1 parent 9ae8fd4 commit 84f714a
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions boefjes/boefjes/clients/bytes_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def wrapper(self, *args, **kwargs): # type: ignore
return function(self, *args, **kwargs)
except HTTPError as error:
if error.response.status_code != 401:
raise error from HTTPError
raise

self.login()
return function(self, *args, **kwargs)
Expand Down Expand Up @@ -67,8 +67,11 @@ def login(self) -> None:
def _verify_response(response: requests.Response) -> None:
try:
response.raise_for_status()
except HTTPError:
logger.error(response.text)
except HTTPError as error:
if error.response.status_code != 401:
logger.error(response.text)
else:
logger.debug(response.text)
raise

def _get_authentication_headers(self) -> Dict[str, str]:
Expand Down

0 comments on commit 84f714a

Please sign in to comment.