We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I have a function, which may return an error state:
@jsonrpc_method('eth_sendRawTransaction') def eth_sendRawTransaction(request, arg1): if arg1 == 1: return "This worked" else: raise Error("This is an error")
The response I would like to get back is the following:
{"error": {"message": "This is an error"}, "jsonrpc": "2.0", "id": 7}
Instead I get a nested error message:
{"error": {"executable": "/home/vagrant/.pyenv/versions/2.7.9/bin/python", "code": 0, "name": "Error", "message": "Error: This is an error", "data": null, "stack": "Traceback (most recent call last):\n File \"/home/vagrant/.pyenv/versions/2.7.9/lib/python2.7/site-packages/jsonrpc/site.py\", line 162, in response_dict\n R = apply_version[version](method, request, D['params'])\n File \"/home/vagrant/.pyenv/versions/2.7.9/lib/python2.7/site-packages/jsonrpc/site.py\", line 125, in <lambda>\n apply_version = {'2.0': lambda f, r, p: f(r, **encode_kw(p)) if type(p) is dict else f(r, *p),\n File \"/home/vagrant/.pyenv/versions/2.7.9/lib/python2.7/site-packages/jsonrpc/__init__.py\", line 242, in exc_printer\n six.reraise(*sys.exc_info())\n File \"/home/vagrant/.pyenv/versions/2.7.9/lib/python2.7/site-packages/jsonrpc/__init__.py\", line 234, in exc_printer\n return _func(*a, **kw)\n File \"/vagrant/factserver/eth/views.py\", line 22, in eth_sendRawTransaction\n raise Error(response[\"error\"])\nError\n"}, "jsonrpc": "2.0", "id": 7}
The text was updated successfully, but these errors were encountered:
No branches or pull requests
I have a function, which may return an error state:
The response I would like to get back is the following:
Instead I get a nested error message:
The text was updated successfully, but these errors were encountered: