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(
452452
453453 :param code_or_exception: An exception class or the status code of HTTP exceptions to
454454 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.
456457 """
457458 if self .middleware_stack is not None :
458459 raise RuntimeError (
Original file line number Diff line number Diff line change @@ -62,7 +62,7 @@ You can register error handlers on:
6262
6363 .. warning ::
6464
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! **
6666
6767 You can also register error handlers on the underlying flask application directly.
6868
@@ -115,7 +115,8 @@ You can register error handlers on:
115115
116116.. note ::
117117
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.
119120
120121.. _Flask documentation : https://flask.palletsprojects.com/en/latest/errorhandling/#error-handlers
121122
You can’t perform that action at this time.
0 commit comments