Skip to content

Commit

Permalink
Merge pull request #53 from durden/patch-1
Browse files Browse the repository at this point in the history
Log exception in RPC function regardless of exception type
  • Loading branch information
pavlov99 committed Oct 21, 2016
2 parents 84ab7ff + 3ab53b6 commit 8f9b6f0
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion jsonrpc/manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,12 +114,14 @@ def response(**kwargs):
"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(
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 8f9b6f0

Please sign in to comment.