Skip to content
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

Error handlers do not seem to work. #5

Closed
thingsneverchange opened this issue Feb 1, 2018 · 1 comment
Closed

Error handlers do not seem to work. #5

thingsneverchange opened this issue Feb 1, 2018 · 1 comment

Comments

@thingsneverchange
Copy link

thingsneverchange commented Feb 1, 2018

I tried both handlers:


@app.errorhandler(404) 
def page_not_found(e): 
    return render_template('/error_handlers/404.html'), 404

and


def not_found():
    return render_template('/error_handlers/404.html'), 404

app.register_error_handler(404, not_found)

None of these seem to work on Quart. I tried the same code on Flask, which seems to work. You can test this simple code here:

from quart import Quart

app = Quart(__name__)

@app.errorhandler(404)
def page_not_found(e):
    return 'Not found lalala', 404

if __name__ == '__main__':
    app.run()
from flask import Flask

app = Flask(__name__)

@app.errorhandler(404)
def page_not_found(e):
    return 'Not found lalala', 404

if __name__ == '__main__':
    app.run()

$> python test.py

What am I doing wrong?

Thanks.

@pgjones
Copy link
Member

pgjones commented Feb 1, 2018

See https://gitlab.com/pgjones/quart/issues/54 for the discussion and (hopeful) fix to this bug.

@pgjones pgjones closed this as completed Feb 1, 2018
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 7, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants