ATS-Doku/.venv/lib/python3.12/site-packages/nicegui/functions/on_exception.py
2026-01-21 13:44:54 +00:00

16 lines
474 B
Python

from typing import Any, Callable, Union
from ..context import context
def on_exception(handler: Union[Callable[[Exception], Any], Callable[[], Any]]) -> None:
"""Register a handler for in-page exceptions (after the page has been sent to the browser).
The callback has an optional parameter of ``Exception``.
*Added in version 3.6.0*
:param handler: callback that is called upon occurrence of the event.
"""
context.client.on_exception(handler)