Method: flask.scaffold.Scaffold.register_error_handler
Calls: 56, Exceptions: 3, Paths: 2Back
Path 1: 53 calls (0.95)
403 (9) AppError def (7) BlueprintError def (7) 500 (7) Exception def (3) Forbidden def (3) HTTPException def (3) 404 (2) test_user_error_handling. _async_app. Path 2: 3 calls (0.05) test_error_handler_no_match. None (3) ValueError (2) TypeError (1)
1@setupmethod
2 def register_error_handler(
3 self,
4 code_or_exception: type[Exception] | int,
5 f: ft.ErrorHandlerCallable,
6 ) -> None:
7 """Alternative error attach function to the :meth:`errorhandler`
8 decorator that is more straightforward to use for non decorator
9 usage.
10
11 .. versionadded:: 0.7
12 """
13 exc_class, code = self._get_exc_class_and_code(code_or_exception)
14 self.error_handler_spec[None][code][exc_class] = f
1@setupmethod
2 def register_error_handler(
3 self,
4 code_or_exception: type[Exception] | int,
5 f: ft.ErrorHandlerCallable,
6 ) -> None:
7 """Alternative error attach function to the :meth:`errorhandler`
8 decorator that is more straightforward to use for non decorator
9 usage.
10
11 .. versionadded:: 0.7
12 """
13 exc_class, code = self._get_exc_class_and_code(code_or_exception)
14 self.error_handler_spec[None][code][exc_class] = f