Skip to content

Commit

Permalink
better logging
Browse files Browse the repository at this point in the history
  • Loading branch information
phact committed Aug 27, 2024
1 parent 34d3b3c commit a2f53bf
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions impl/astra_vector.py
Original file line number Diff line number Diff line change
Expand Up @@ -353,11 +353,13 @@ def connect(self, retry=False):
raise HTTPException(401, f"{TOKEN_AUTH_FAILURE_MESSAGE}: {e}")

except NoHostAvailable as e:
for db_url, error in e.errors.items():
if isinstance(error, Unauthorized):
raise HTTPException(
401, f"{TOKEN_AUTH_FAILURE_MESSAGE}: {e}"
)
logger.error(f"connecton error, dbid: {self.dbid}, error: {e}")
if hasattr(e, "errors") and hasattr(e.errors, "items"):
for db_url, error in e.errors.items():
if isinstance(error, Unauthorized):
raise HTTPException(
401, f"{TOKEN_AUTH_FAILURE_MESSAGE}: {e}"
)
raise

except DriverException as e:
Expand Down

0 comments on commit a2f53bf

Please sign in to comment.