I\'ve been banging my head against this method in Flask for some time, and while it seems I\'m making progress now, I\'ve just happened upon something that baffles me to no
I had the same issue, but the underlying cause was different than the one in Slater's response:
I was muting the logger that the stack trace goes to. Be sure that you are not filtering out the flask.app
logger, which is where the exception stack traces go to (note that this is different than the flask server's informational logs, named app.api
).
After beating my head against this some more I finally figured it out thanks to the awesome people on the pocoo google group (I have since learned that there is a separate list for flask). Firstly, I needed to turn on the PROPAGATE_EXCEPTIONS
option in my app configuration (http://flask.pocoo.org/docs/config/#builtin-configuration-values).
After that was done I realized there was an issue with not returning a response from a view function, which Flask interpreted this method as. Since that was the case, this issue was resolved by just adding:
return jsonify(result={"status": 200})
To the end of the try
block. I hope this helps someone in a similar situation in the future.