Package limn.backend
Interface CrashHandler
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
Application hook for crashes the toolkit caught in the event loop. Install
via
Crashes.install(limn.backend.CrashHandler) to log to your own sink, save state, show your
own error UI, or decide that the application should shut down.
Runs on the UI thread, inside the loop iteration that caught the crash; keep it fast and never throw (a throwing handler is itself contained and treated as "continue").
-
Method Summary
Modifier and TypeMethodDescriptionbooleancrashed(CrashPhase phase, Throwable error) Called with every crash the toolkit contains.
-
Method Details
-
crashed
Called with every crash the toolkit contains.Whether the return value is honored depends on the containment site, not on the phase, since the same phase can arrive from both kinds:
- Honored at coarse sites, where the crash would otherwise
have been fatal: a scene frame and a deferred GPU disposal
(
FRAME), the native event poll (EVENT_POLL), the event loop's per-window input/frame backstops (INPUT,FRAME), and window teardown as a whole (WINDOW_CLOSE, backend side). - Ignored at fine-grained sites that contain and continue by
design: one input event (
INPUT), one posted task (TASK), one ticker (TICKER), one window-close callback (WINDOW_CLOSE, scene side), reported for observability only.
- Parameters:
phase- where the application code was executingerror- what it threw- Returns:
trueto keep the application running (the toolkit recovers: repaints, retries, or skips; seeCrashes);falseto request an orderly shutdown where honored
- Honored at coarse sites, where the crash would otherwise
have been fatal: a scene frame and a deferred GPU disposal
(
-