Skip to content

Commit

Permalink
Improve connection errors. (#209)
Browse files Browse the repository at this point in the history
- No micromanagment of error types, just dump the error text back to the user.
  • Loading branch information
terjekv authored Feb 19, 2024
1 parent 0cbd52a commit 1f25a27
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions mreg_cli/utilities/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,8 @@ def try_token_or_login(user: str, url: str, fail_without_token: bool = False) ->
params={"page_size": 1},
timeout=5,
)
except requests.exceptions.ConnectionError:
error(f"Could not connect to {url}")
except requests.exceptions.ConnectionError as e:
error(f"Could not connect to {url}: {e}")

if ret.status_code == 401:
if fail_without_token:
Expand Down

0 comments on commit 1f25a27

Please sign in to comment.