flask-pymongo icon indicating copy to clipboard operation
flask-pymongo copied to clipboard

Collection.find_one_or_404 hides stack trace

Open Joe-Heffer-Shef opened this issue 1 year ago • 0 comments

Hi,

When I try to retrieve a single item from a MongoDB collection and it isn't present, I want an error to be raised, which is the purpose of Collection.find_one_or_404. However, a 404 screen is shown which prevents me from seeing a stack trace (in Flask debug mode.)

Please could find_one_or_404 instead raise some kind of not-found exception, rather than using flask.abort. This way, I could see the stack trace (or handle the error appropriately using Flask error handlers.)

Joe-Heffer-Shef avatar Aug 23 '22 10:08 Joe-Heffer-Shef