Package limn.backend

Class Crashes

java.lang.Object
limn.backend.Crashes

public final class Crashes extends Object
Crash containment registry: one process-wide CrashHandler (default: log and continue) that the toolkit and backend notify whenever application code throws inside the event loop. Install/uninstall follows the same static-registry pattern as Sounds/Images.

Containment map (an exception in application code never kills the event loop outright anymore):

  • FRAME: Scene.renderFrame catches (and pauses ticking + self-retries after a few consecutive failures, so a deterministic crash cannot spin the CPU; input still retries); deferred GPU disposals are contained per runnable. Both honor the handler's verdict.
  • EVENT_POLL/INPUT/FRAME/WINDOW_CLOSE: the backend loop and window teardown catch per site, keep the other windows alive, honor the verdict, and give up (rethrow) only after many consecutive crashed iterations.
  • INPUT/TASK/TICKER/WINDOW_CLOSE (scene side): contained per event/task/ticker/close-callback; they report(limn.backend.CrashPhase, java.lang.Throwable) here for observability and ignore the verdict; see CrashHandler.crashed(limn.backend.CrashPhase, java.lang.Throwable) for the honored-vs-ignored map.
  • Method Details

    • install

      public static void install(CrashHandler crashHandler)
      Installs the process-wide handler (replacing the log-and-continue default).
    • uninstall

      public static void uninstall(CrashHandler crashHandler)
      Uninstalls crashHandler if it is the current one, restoring the default.
    • dispatch

      public static boolean dispatch(CrashPhase phase, Throwable error)
      Dispatches a crash caught at a site where it would otherwise have been fatal. A throwing handler is contained and treated as "continue".
      Returns:
      true to keep running, false when the handler requested shutdown (the caller should throw shutdownRequested(java.lang.Throwable))
    • report

      public static void report(CrashPhase phase, Throwable error)
      Notifies the handler of a crash at a site that already contains and logs it locally (input/task/ticker). No-op with the default handler (the site's own log line already tells the story), and the return value is ignored.
    • shutdownRequested

      public static Crashes.ShutdownRequested shutdownRequested(Throwable cause)
      The exception a containment site throws after dispatch(limn.backend.CrashPhase, java.lang.Throwable) returned false.