Skip to content
Myr

Moved noted about HTTP 500 before the code examples

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

- as suggested by @keyan

authored by Torstein Krause Johansen · committed by Torstein Krause Johansen · parent 5dd9335 · Browse files · 1 file+3 added−2 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+3 added−2 removed

  • other:+3 added−2 removed

1 file+3 added−2 removed

modified:docs/patterns/errorpages.rst+3 added-2 removed
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
12 unmodified lines
80 <p>What you were looking for is just not there.81 <p><a href="{{ url_for('index') }}">go somewhere nice</a>82 {% endblock %}8381Please note that if you add an error handler for "500 Internal Server82Error", Flask will not trigger it if it's running in Debug mode.