Skip to content

Commit

Permalink
fix error raising
Browse files Browse the repository at this point in the history
  • Loading branch information
mki-c2c committed Jan 27, 2025
1 parent c0a1ade commit 5359be8
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions backend/maelstro/config/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,12 @@ def get_access_info(
)
try:
info = next(infos)
except StopIteration:
except StopIteration as exc:
raise ConfigError(
f"Key {instance_id} could not be found among "
f"configured {'geonetwork' if is_geonetwork else 'geoserver'} "
"source servers."
)
) from exc
else:
inst_type = "geonetwork" if is_geonetwork else "geoserver"
url_key = "api_url" if is_geonetwork else "url"
Expand All @@ -69,12 +69,12 @@ def get_access_info(
for name, inst in self.config["destinations"].items()
if name == instance_id
)[inst_type]
except StopIteration:
except StopIteration as exc:
raise ConfigError(
f"Key {instance_id} could not be found among "
f"configured {'geonetwork' if is_geonetwork else 'geoserver'} "
"destination servers."
)
) from exc
info = {
"auth": (instance.get("login"), instance.get("password")),
"url": instance[url_key],
Expand Down

0 comments on commit 5359be8

Please sign in to comment.