include fn name and args in jsonrpc error message

This commit is contained in:
Alex Grintsvayg 2019-10-04 11:25:01 -04:00
parent 2c73c80c9f
commit 27bbd91635
No known key found for this signature in database
GPG key ID: AEB3F089F86A22B5

View file

@ -591,7 +591,9 @@ class Daemon(metaclass=JSONRPCServerType):
except Exception as e: # pylint: disable=broad-except except Exception as e: # pylint: disable=broad-except
log.exception("error handling api request") log.exception("error handling api request")
return JSONRPCError( return JSONRPCError(
str(e), JSONRPCError.CODE_APPLICATION_ERROR, format_exc() f"Error calling {function_name} with args {args}\n" + str(e),
JSONRPCError.CODE_APPLICATION_ERROR,
format_exc()
) )
def _verify_method_is_callable(self, function_path): def _verify_method_is_callable(self, function_path):