Skip to content

Commit

Permalink
Explicit error message if no connection to IIASA manager service
Browse files Browse the repository at this point in the history
  • Loading branch information
danielhuppmann committed Nov 3, 2023
1 parent 7325a37 commit d29dc75
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pyam/iiasa.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,10 @@ def __init__(self, creds: str = None, auth_url: str = _AUTH_URL):
f"{IXMP4_LOGIN} instead."
)

# self.auth is None if connection to manager service cannot be established
if self.auth is None:
raise httpx.ConnectError("No connection to IIASA manager service.")

Check warning on line 101 in pyam/iiasa.py

View check run for this annotation

Codecov / codecov/patch

pyam/iiasa.py#L101

Added line #L101 was not covered by tests

# explicit token for anonymous login is not necessary for ixmp4 platforms
# but is required for legacy Scenario Explorer databases
if self.auth.user.username == "@anonymous":
Expand Down

0 comments on commit d29dc75

Please sign in to comment.