Skip to content

Commit

Permalink
Print args and kwargs when FirestoreConnectorError is raised
Browse files Browse the repository at this point in the history
  • Loading branch information
vricciardulli committed Jul 28, 2022
1 parent 3acaeca commit 4dc7565
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions dealroom_firestore_connector/exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,9 @@ def wrapper(*args, **kwargs):
try:
return func(*args, **kwargs)
except FirestoreConnectorError as exc:
print(f"{func.__class__.__name__}: {exc.__class__.__name__}, {exc}")
return StatusCode.ERROR
except InvalidArgument as exc:
# this error is difficult to track, at least in this way we have a clue why or which process is raising it
print(
f"{func.__class__.__name__}: {exc.__class__.__name__}, {exc} - args = {json.dumps(args, default=str)} - kwargs = {json.dumps(kwargs, default=str)}"
)
raise exc
return StatusCode.ERROR

return wrapper

0 comments on commit 4dc7565

Please sign in to comment.