Skip to content

Commit

Permalink
Log exception in RPC function regardless of exception type
Browse files Browse the repository at this point in the history
It's useful as a server-side developer to see the stack trace regardless if the error is a TypeError or not.
  • Loading branch information
durden committed Oct 19, 2016
1 parent 5605dc5 commit 38a0162
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion jsonrpc/manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,8 @@ def response(**kwargs):
except JSONRPCDispatchException as e:
output = response(error=e.error._data)
except Exception as e:
logger.exception("API Exception:")

data = {
"type": e.__class__.__name__,
"args": e.args,
Expand All @@ -119,7 +121,6 @@ def response(**kwargs):
output = response(
error=JSONRPCInvalidParams(data=data)._data)
else:
logger.exception("API Exception: {0}".format(data))
output = response(
error=JSONRPCServerError(data=data)._data)
else:
Expand Down

0 comments on commit 38a0162

Please sign in to comment.