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..handle def (7) _async_app..bp_handle def (7) TestGenericHandlers.test_handle_class_or_code..handle_500 def (2) tes...

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
            

Path 2: 3 calls (0.05)

test_error_handler_no_match..CustomException (1) list def (1) 999 (1)

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