Skip to content

Commit

Permalink
Better Neptune client query error messages (#213)
Browse files Browse the repository at this point in the history
  • Loading branch information
jbmchuck committed Nov 28, 2023
1 parent 591ded9 commit 6c13560
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions altimeter/core/neptune/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -686,10 +686,8 @@ def run_raw_query(self, query: str) -> QueryResultSet:
try:
results_json = resp.json()
except json.decoder.JSONDecodeError as jde:
neptune_status = resp.headers.get("X-Neptune-Status", "unknown")
neptune_detail = resp.headers.get("X-Neptune-Detail", "unknown")
raise NeptuneQueryException(
f"Error running query {query}: {neptune_status}: {neptune_detail}"
f"Error running query {query}:\nResponse headers: {resp.headers}\nRoot cause: {jde}\n"
) from jde
return QueryResultSet.from_sparql_endpoint_json(results_json)

Expand Down

0 comments on commit 6c13560

Please sign in to comment.