Liga-System/.venv/lib/python3.12/site-packages/nicegui/functions/on_exception.py
2026-02-16 08:18:53 +00:00

17 lines
488 B
Python

from collections.abc import Callable
from typing import Any
from ..context import context
def on_exception(handler: 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)