Liga-System/.venv/lib/python3.12/site-packages/nicegui/functions/on_exception.py

17 lines
488 B
Python
Raw Normal View History

2026-02-16 09:18:53 +01:00
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)