@app.errorhandler() cannot be used in blueprint when debug=False #5431
Unanswered
mengshun2022
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I want to customize an error type in Flask, and then use
@app.errorhandler()
in the main program to capture it. Then, I define a function raise_error to actively throw this exception. Whendebug=True
is enabled at runtime, both the main and blueprint routes can be used normally in the interface function. However, whendebug=False
, only the main route can be used, and the blueprint route cannot capture it and reports a program error,I hope someone can help me take a lookThere are two files in total(
mains.py
,aaa.py
)Beta Was this translation helpful? Give feedback.
All reactions