Moved noted about HTTP 500 before the code examples

- as suggested by @keyan
This commit is contained in:
Torstein Krause Johansen 2015-03-31 19:16:33 +02:00
parent 5dd9335aac
commit 557a053e3b

View file

@ -58,6 +58,9 @@ decorator and the error code of the exception. Keep in mind that Flask
will *not* set the error code for you, so make sure to also provide the
HTTP status code when returning a response.
Please note that if you add an error handler for "500 Internal Server
Error", Flask will not trigger it if it's running in Debug mode.
Here an example implementation for a "404 Page Not Found" exception::
from flask import render_template
@ -78,5 +81,3 @@ An example template might be this:
<p><a href="{{ url_for('index') }}">go somewhere nice</a>
{% endblock %}
Please note that if you add an error handler for "500 Internal Server
Error", Flask will not trigger it if it's running in Debug mode.