Skip to content

Commit

Permalink
print parser error
Browse files Browse the repository at this point in the history
  • Loading branch information
callebtc committed Sep 17, 2023
1 parent 5e00154 commit e81d505
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion cashu/wallet/wallet.py
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,11 @@ def raise_on_error(resp: Response) -> None:
Raises:
Exception: if the response contains an error
"""
resp_dict = resp.json()
try:
resp_dict = resp.json()
except Exception:
logger.error(f"Could not parse response from mint: {resp.text}")
raise Exception(f"Could not parse response from mint: {resp.text}")
if "detail" in resp_dict:
logger.trace(f"Error from mint: {resp_dict}")
error_message = f"Mint Error: {resp_dict['detail']}"
Expand Down

0 comments on commit e81d505

Please sign in to comment.