Skip to content
This repository has been archived by the owner on Nov 19, 2024. It is now read-only.

Commit

Permalink
Docs: Remove deprecated register_error_handlers method in warning
Browse files Browse the repository at this point in the history
  • Loading branch information
Mews committed Jun 12, 2024
1 parent e3f9c6c commit 1901a13
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions docs/source/api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,21 @@ Custom exceptions
-----------------

.. warning:: For any of these errors to work, you need to register the error handlers in your Flask app.
To do this, you can call :meth:`register_error_handlers` with your Flask app as an argument.

To do this, you need to pass :attr:`register_error_handlers=True` to the :class:`FlaskUtils` class or to :meth:`~FlaskUtils.init_app()`.

.. code-block:: python
from flask import Flask
from flask_utils import FlaskUtils
app = Flask(__name__)
utils = FlaskUtils(app, register_error_handlers=True)
# OR
from flask_utils import register_error_handlers
register_error_handlers(app)
utils = FlaskUtils()
utils.init_app(app, register_error_handlers=True)
.. automodule:: flask_utils.errors
:members:
Expand Down

0 comments on commit 1901a13

Please sign in to comment.