File tree Expand file tree Collapse file tree 2 files changed +5
-3
lines changed Expand file tree Collapse file tree 2 files changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -452,7 +452,8 @@ def add_error_handler(
452
452
453
453
:param code_or_exception: An exception class or the status code of HTTP exceptions to
454
454
handle.
455
- :param function: Callable that will handle exception, may be async.
455
+ :param function: Callable that will handle the exception and return a ConnexionResponse such
456
+ as a `connexion.problem.problem`. May be async; a sync function is run in a threadpool.
456
457
"""
457
458
if self .middleware_stack is not None :
458
459
raise RuntimeError (
Original file line number Diff line number Diff line change @@ -62,7 +62,7 @@ You can register error handlers on:
62
62
63
63
.. warning ::
64
64
65
- ⚠️ **The following is not recommended as it complicates the exception handling logic, **
65
+ ⚠️ **The following is not recommended as it complicates the exception handling logic! **
66
66
67
67
You can also register error handlers on the underlying flask application directly.
68
68
@@ -115,7 +115,8 @@ You can register error handlers on:
115
115
116
116
.. note ::
117
117
118
- Error handlers can be ``async `` coroutines as well.
118
+ Error handlers can be ``async `` coroutines as well. If the error handler needs to log
119
+ the exception, pass the exception using the Python logger's ``exc_info `` parameter.
119
120
120
121
.. _Flask documentation : https://flask.palletsprojects.com/en/latest/errorhandling/#error-handlers
121
122
You can’t perform that action at this time.
0 commit comments