Closed vimalloc closed 8 years ago
Hi, you just need to activate the PROPAGATE_EXCEPTIONS configuration in the Flask app. (which is activated automatically when debug is set to True)
app.config['PROPAGATE_EXCEPTIONS'] = True
and you will get the messages again...
D'oh! I wasn't aware of that flask option. Thanks for info! :)
Is it secure to set PROPAGATE_EXCEPTIONS
in production?
TBH it's more secure to raise a generic "internal error" than a descriptive one, but also it can help your users or even the rest of your code to understand why it failed
Thanks for Your answer and Great After doing this ['PROPAGATE_EXCEPTIONS'] = True this setting resolve my issue in production server.
When I have debug = True in the flask application, and I make a call to a jwt protected endpoint without an access token I get the following back:
However, when I try the same thing with debug = False, instead I get this:
And in the logs, I see:
As far as I can tell, the jwt.init_app() function is registering a custom error handler for JWTErrors in the flask app, however it only seems to be working when flask debug is enabled. Any ideas why this might be the case?