def __init__(
self,
handlers: Optional[
Dict[
Type[Exception],
GeneralExceptionHandler,
]
] = None,
publish_handlers: Optional[
Dict[
Type[Exception],
PublishingExceptionHandler,
]
] = None,
) -> None:
self._handlers: CastedHandlers = [
(IgnoredException, ignore_handler),
*(
(
exc_type,
apply_types(
cast(Callable[..., Awaitable[None]], to_async(handler))
),
)
for exc_type, handler in (handlers or {}).items()
),
]
self._publish_handlers: CastedPublishingHandlers = [
(IgnoredException, ignore_handler),
*(
(exc_type, apply_types(to_async(handler)))
for exc_type, handler in (publish_handlers or {}).items()
),
]