Skip to content

Commit

Permalink
Updated how we handle caught errors in get_endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
stvoutsin committed Jan 27, 2025
1 parent 468fdb6 commit 8339b14
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion pyvo/dal/vosi.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,13 @@ def _get_endpoint_candidates(self, endpoint):
def _get_endpoint(self, endpoint):
"""Attempt to connect to service endpoint"""
attempted_urls = []
candidates = self._get_endpoint_candidates(endpoint)
try:
candidates = self._get_endpoint_candidates(endpoint)
except (ValueError, AttributeError) as e:
raise DALServiceError(
f"Cannot construct endpoint URL from base '{self.baseurl}' and endpoint '{endpoint}'. "
f"{type(e).__name__}: {str(e)}"
) from e

for ep_url in candidates:
try:
Expand Down

0 comments on commit 8339b14

Please sign in to comment.