-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Error handlers are synchronous #1785
Comments
This one seems to be hard to fix because of how asyncio protocols work. The I suppose this could be worked around by using Anyone willing to weigh in, or should I just modify the code and see if tests break? |
I've confirmed that this is now fixed in the streaming branch. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If this is incorrect, please respond with an update. Thank you for your contributions. |
This should probably not be closed until the fix is merged |
+1 |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If this is incorrect, please respond with an update. Thank you for your contributions. |
No, this issue is not stale, it still hasn't been fixed |
Describe the bug
The documentation says that error handlers can be asynchronous.
However, asynchronous error handlers do not seem to be supported everywhere.
Code snippet
Expected behavior
Then, for example when I exceed the
REQUEST_MAX_SIZE
limit, I would expect to receive"too bad"
as a response.Unfortunately, sanic contains code like https://github.com/huge-success/sanic/blob/91f6abaa81248189fbcbdf685e8bdcbb7846609f/sanic/server.py#L577-L579
which expects the error handler to be synchronous.
Actual behavior
Here are the (verbose) logs of the actual results:
The text was updated successfully, but these errors were encountered: