Participer au site avec un Tip
Rechercher
 

Améliorations / Corrections

Vous avez des améliorations (ou des corrections) à proposer pour ce document : je vous remerçie par avance de m'en faire part, cela m'aide à améliorer le site.

Emplacement :

Description des améliorations :

Vous êtes un professionnel et vous avez besoin d'une formation ? Sensibilisation à
l'Intelligence Artificielle
Voir le programme détaillé
Classe « Flask »

Méthode flask.Flask.handle_exception

Signature de la méthode handle_exception

def handle_exception(self, e: 'Exception') -> 'Response' 

Description

help(Flask.handle_exception)

Handle an exception that did not have an error handler
associated with it, or that was raised from an error handler.
This always causes a 500 ``InternalServerError``.

Always sends the :data:`got_request_exception` signal.

If :data:`PROPAGATE_EXCEPTIONS` is ``True``, such as in debug
mode, the error will be re-raised so that the debugger can
display it. Otherwise, the original exception is logged, and
an :exc:`~werkzeug.exceptions.InternalServerError` is returned.

If an error handler is registered for ``InternalServerError`` or
``500``, it will be used. For consistency, the handler will
always receive the ``InternalServerError``. The original
unhandled exception is available as ``e.original_exception``.

.. versionchanged:: 1.1.0
    Always passes the ``InternalServerError`` instance to the
    handler, setting ``original_exception`` to the unhandled
    error.

.. versionchanged:: 1.1.0
    ``after_request`` functions and other finalization is done
    even for the default 500 response when there is no handler.

.. versionadded:: 0.3


Vous êtes un professionnel et vous avez besoin d'une formation ? RAG (Retrieval-Augmented Generation)
et Fine Tuning d'un LLM
Voir le programme détaillé