Skip to content
Myr

Merge pull request #1413 from skybert/500-errhandler-note

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Added note that @errorhandler(500) isn't triggered in debug mode

authored by Keyan Pishdadian · committed by Keyan Pishdadian · parents c259f2b, 557a053 · Browse files · 1 file+4 added−0 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+4 added−0 removed

  • other:+4 added−0 removed

1 file+4 added−0 removed

modified:docs/patterns/errorpages.rst+4 added
56 unmodified lines
57decorator and the error code of the exception. Keep in mind that Flask58will *not* set the error code for you, so make sure to also provide the59HTTP status code when returning a response.6061Please note that if you add an error handler for "500 Internal Server62Error", Flask will not trigger it if it's running in Debug mode.6364Here an example implementation for a "404 Page Not Found" exception::6566 from flask import render_template67
11 unmodified lines
79 <h1>Page Not Found</h1>80 <p>What you were looking for is just not there.81 <p><a href="{{ url_for('index') }}">go somewhere nice</a>82 {% endblock %}83