Skip to content
New issue

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

Incorrect attribute access causing response middleware errors #178

Open
john-g-g opened this issue Jun 4, 2018 · 0 comments
Open

Incorrect attribute access causing response middleware errors #178

john-g-g opened this issue Jun 4, 2018 · 0 comments
Assignees
Labels

Comments

@john-g-g
Copy link
Contributor

john-g-g commented Jun 4, 2018

if request.method == 'POST' and isinstance(request.json, JussiJSONRPCRequest):
will, in some circumstances produce this error:

{
  "event": "finalize_jussi error",
  "logger": "jussi.middlewares.jussi",
  "level": "warning",
  "exception": "Traceback (most recent call last):\n 
File \"/app/.venv/lib/python3.6/site-packages/sanic/request.py\", line 89, in load_json\n self.parsed_json = loads(self.body)\n
ValueError: Expected object or value\n\n
During handling of the above exception, another exception occurred:\n\nTraceback (most recent call last):\n 
File \"/app/jussi/middlewares/jussi.py\", line 56, in finalize_jussi_response\n 
if request.method == POST and isinstance(request.json, JussiJSONRPCRequest):\n 
File \"/app/.venv/lib/python3.6/site-packages/sanic/request.py\", line 83, in json\n
self.load_json()\n 
File \"/app/.venv/lib/python3.6/site-packages/sanic/request.py\", line 93, in load_json\n 
raise InvalidUsage(\"Failed when parsing body as json\")\n
sanic.exceptions.InvalidUsage: Failed when parsing body as json"
}
@john-g-g john-g-g added the bug label Jun 4, 2018
@john-g-g john-g-g self-assigned this Jun 4, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant