Browse Source

Mention register_error_handler in errorhandler doc

The documentation for @errorhandler gives "app.error_handler_spec[None][404] = page_not_found" as an example for adding an error handler without the decorator.  However, register_error_handler appears to be the correct way to do this (added 0.7), and it eliminates the problems with modifying error_handler_spec directly.
pull/707/head
Steve Leonard 12 years ago
parent
commit
b9355a7d5f
  1. 5
      flask/app.py

5
flask/app.py

@ -1065,6 +1065,11 @@ class Flask(_PackageBoundObject):
The first `None` refers to the active blueprint. If the error
handler should be application wide `None` shall be used.
.. versionadded:: 0.7
Use :meth:`register_error_handler` instead of modifying
:attr:`error_handler_spec` directly, for application wide error
handlers.
.. versionadded:: 0.7
One can now additionally also register custom exception types
that do not necessarily have to be a subclass of the

Loading…
Cancel
Save