squeaky-pl / japronto

Screaming-fast Python 3.5+ HTTP toolkit integrated with pipelining HTTP server based on uvloop and picohttpparser.
MIT License
8.61k stars 581 forks source link

Invalid status code #131

Open aarjan opened 6 years ago

aarjan commented 6 years ago

When i run a simple Japronto server, and send 422 request code, it returns following error: {"message": "Unhandled exception in event loop", "lineno": 182, "pathname": "/home/aarjan/anaconda3/lib/python3.6/site-packages/japronto/app/init.py", "exc_info": "Traceback (most recent call last):\n File \"uvloop/handles/stream.pyx\", line 785, in uvloop.loop.__uv_stream_on_read_impl (uvloop/loop.c:76307)\n File \"uvloop/handles/stream.pyx\", line 559, in uvloop.loop.UVStream._on_read (uvloop/loop.c:73571)\nValueError: Invalid status code"}

The code is simple: def hello(): return request.Response( code=422, json={"error":"schema error"}, )

It worked for other error code though.