Example usage for org.springframework.util ErrorHandler handleError

List of usage examples for org.springframework.util ErrorHandler handleError

Introduction

In this page you can find the example usage for org.springframework.util ErrorHandler handleError.

Prototype

void handleError(Throwable t);

Source Link

Document

Handle the given error, possibly rethrowing it as a fatal exception.

Usage

From source file:org.springframework.context.event.SimpleApplicationEventMulticaster.java

/**
 * Invoke the given listener with the given event.
 * @param listener the ApplicationListener to invoke
 * @param event the current event to propagate
 * @since 4.1//from  w  w w  .  ja  va2s.  c  om
 */
protected void invokeListener(ApplicationListener<?> listener, ApplicationEvent event) {
    ErrorHandler errorHandler = getErrorHandler();
    if (errorHandler != null) {
        try {
            doInvokeListener(listener, event);
        } catch (Throwable err) {
            errorHandler.handleError(err);
        }
    } else {
        doInvokeListener(listener, event);
    }
}