Added HTTP exception trapping. This should fix #294

This commit is contained in:
Armin Ronacher 2011-08-05 12:35:41 +02:00
parent a070b4fe86
commit 7155f11a72
4 changed files with 86 additions and 8 deletions

View file

@ -81,6 +81,23 @@ The following configuration values are used internally by Flask:
reject incoming requests with a
content length greater than this by
returning a 413 status code.
``TRAP_HTTP_EXCEPTIONS`` If this is set to ``True`` Flask will
not execute the error handlers of HTTP
exceptions but instead treat the
exception like any other and bubble it
through the exception stack. This is
helpful for hairy debugging situations
where you have to find out where an HTTP
exception is coming from.
``TRAP_BAD_REQUEST_KEY_ERRORS`` Werkzeug's internal data structures that
deal with request specific data will
raise special key errors that are also
bad request exceptions. By default
these will be converted into 400
responses which however can make
debugging some issues harder. If this
config is set to ``True`` you will get
a regular traceback instead.
================================= =========================================
.. admonition:: More on ``SERVER_NAME``
@ -114,6 +131,9 @@ The following configuration values are used internally by Flask:
.. versionadded:: 0.7
``PROPAGATE_EXCEPTIONS``, ``PRESERVE_CONTEXT_ON_EXCEPTION``
.. versionadded:: 0.8
``TRAP_BAD_REQUEST_KEY_ERRORS``, ``TRAP_HTTP_EXCEPTIONS``
Configuring from Files
----------------------