Class ErrorReporter

java.lang.Object
megalodonte.application.ErrorReporter

public final class ErrorReporter extends Object
Central error handler for the framework. Unhandled exceptions from Async and Scope are routed here.

Applications should register a UI-specific handler via register(ErrorReporter.Handler) at bootstrap time. If none is registered, a fallback prints to stderr.

All errors are also appended to ~/.megalodonte/errors.log for post-mortem analysis.

  • Method Details

    • register

      public static void register(ErrorReporter.Handler appHandler)
      Registers the application-specific error handler. Called once at bootstrap.
      Parameters:
      appHandler - the error handler implementation
    • handle

      public static void handle(Throwable t)
      Reports an error by logging it to file and delegating to the registered handler.
      Parameters:
      t - the throwable to report