You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Your example is not supposed to work the way you intend it to. Blueprint exception handlers are only supposed to handle exceptions that happen within their own scope. In your example, you're attaching an error handler to the blueprint, but your route is being attached to the app instance directly, not the blueprint.
The fact that it used to work was an unintended side-effect/bug which was fixed here: #2246
Your example is not supposed to work the way you intend it to. Blueprint exception handlers are only supposed to handle exceptions that happen within their own scope. In your example, you're attaching an error handler to the blueprint, but your route is being attached to the app instance directly, not the blueprint.
The fact that it used to work was an unintended side-effect/bug which was fixed here: #2246
We are currently just using blueprints for error handling. I guess our options would then be to either drop blueprints and attach handlers to the app or move the routing to the blueprints entirely.
A bit unfortunately but at least it's clear where our problem is at now. Thank you!
Describe the bug
Error handler on the blueprint is no longer working with 21.9.0. Worked fine on 21.6.2
Code snippet
I've created a reproducible simplified version on the repo here: https://github.com/aericson/sanic-blueprint-error-demo
You should be able to see the error on the Github Action here: https://github.com/aericson/sanic-blueprint-error-demo/actions/runs/1295855511
server:
Expected behavior
Expected a request to
/
to respond with the return of the error handler. Returned 500 instead.Environment (please complete the following information):
The text was updated successfully, but these errors were encountered: