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

Fix default error handler #203

Merged
merged 3 commits into from May 14, 2019

Conversation

Projects
None yet
1 participant
@fluffy-critter
Copy link
Collaborator

commented May 14, 2019

Summary

Show a default error page if no error template is provided; Fixes #135

Detailed description

It's unclear where the default Flask error handler actually comes from or how to trigger it (flask.abort() simply throws an HTTPException which causes an exception loop) so instead we embed a simple template into Publ itself. This has the benefit of providing slightly more information anyway.

Test plan

Used ./runTests.sh to check the following URLs:

http://localhost:5000/asdf
http://localhost:5000/error
http://localhost:5000/err/
http://localhost:5000/2348242
http://localhost:5000/err/2348242

Used pipenv run python3 ./tests.py to run in prod and checked the same URLs. In particular, /err/ should show the templates/err/error.html template in production but still show a stack trace in test.

Got a site to show off?

@fluffy-critter fluffy-critter merged commit dd4f677 into master May 14, 2019

@fluffy-critter fluffy-critter deleted the feature/135-default-errors branch May 14, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.