Skip to content

Commit

Permalink
Log exception with data argument
Browse files Browse the repository at this point in the history
This gives the exception message more context with the data that will be returned in response.
  • Loading branch information
durden committed Oct 19, 2016
1 parent 38a0162 commit a1f17fe
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions jsonrpc/manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,13 +109,14 @@ 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,
"message": str(e),
}

logger.exception("API Exception: {0}".format(data))

if isinstance(e, TypeError) and is_invalid_params(
method, *request.args, **request.kwargs):
output = response(
Expand Down

0 comments on commit a1f17fe

Please sign in to comment.