Package com.oorian

Interface ExceptionHandler

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 ExceptionHandler
Functional interface for centralized exception handling in Oorian applications.

When registered via Application.setExceptionHandler(ExceptionHandler), this handler is invoked whenever an uncaught exception occurs during:

  • Page creation (createHead(), createBody())
  • Event handler processing (WebSocket/AJAX/SSE message handling)
  • Background worker thread execution (OorianWorkerThread)

The handler receives the exception and the associated page (if available). After the handler is invoked, the framework continues with its default error behavior (rendering an error page for initial requests, or pushing an error notification for WebSocket/SSE connections).

Usage:


 setExceptionHandler((exception, page) -> {
     // Log to external monitoring service
     MonitoringService.reportError(exception);

     // Additional custom handling
     if (page != null) {
         LOG.error("Exception on page: " + page.getClass().getName(), exception);
     }
 });
 
Since:
2.1
Version:
1.0
Author:
Marvin P. Warble Jr.
See Also:
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    handle(Exception exception, HtmlPage page)
    Handles an uncaught exception from the Oorian framework.
  • Method Details

    • handle

      void handle(Exception exception, HtmlPage page)
      Handles an uncaught exception from the Oorian framework.
      Parameters:
      exception - the exception that occurred
      page - the page associated with the exception, or null if no page context is available