New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Flask's abort(404) does not work with Zero #133
Comments
And as usual, I finally figured it out myself right after posting the question: from flask import make_response
def handler(name):
if not VIDEO_PATH.joinpath(name).exists():
return make_response("", 404)
# ... I still think |
Hubro
changed the title
How do I return a 404 Not Found error from a Python file?
Flask's abort(404) does not work with Zero
Jun 5, 2020
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I've made a Python API file for fetching a resource. If the resource doesn't exist, I want to return "404 Not Found". I have tried Flask's
abort(404)
, but the NotFound error is caught at some point and I get a TypeError instead, resulting in a 500 Server Error from Zero. Here is the stack trace:Is this a bug? Or is there a different way to do it?
The text was updated successfully, but these errors were encountered: