forked from orbit-oss/flask
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.
This commit is contained in:
parent
6309987dca
commit
b9355a7d5f
1 changed files with 5 additions and 0 deletions
|
|
@ -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…
Add table
Add a link
Reference in a new issue