Interface ObserverErrorHandler

All Known Implementing Classes:
DefaultObserverErrorHandler
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 ObserverErrorHandler
Functional interface for handling exceptions thrown by observers.

Observer callbacks should not throw exceptions, but if they do, this handler provides a way for applications to intercept and handle those exceptions (e.g., for logging or monitoring).

Example usage:


 doc.setObserverErrorHandler((exception, source) -> {
     logger.error("Observer error in {}: {}", source, exception.getMessage(), exception);
 });
 
See Also: