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.

@FunctionalInterface public interface CrashHandler
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 Type
    Method
    Description
    boolean
    crashed(CrashPhase phase, Throwable error)
    Called with every crash the toolkit contains.
  • Method Details

    • crashed

      boolean crashed(CrashPhase phase, Throwable error)
      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.
      A handler deciding shutdown should therefore decide by policy (always / never / by error type), not by phase.
      Parameters:
      phase - where the application code was executing
      error - what it threw
      Returns:
      true to keep the application running (the toolkit recovers: repaints, retries, or skips; see Crashes); false to request an orderly shutdown where honored