Example usage for org.springframework.web.context.request.async CallableProcessingInterceptor handleError

List of usage examples for org.springframework.web.context.request.async CallableProcessingInterceptor handleError

Introduction

In this page you can find the example usage for org.springframework.web.context.request.async CallableProcessingInterceptor handleError.

Prototype

default <T> Object handleError(NativeWebRequest request, Callable<T> task, Throwable t) throws Exception 

Source Link

Document

Invoked from a container thread when an error occurred while processing the async request before the Callable task completes.

Usage

From source file:org.springframework.web.context.request.async.CallableInterceptorChain.java

public Object triggerAfterError(NativeWebRequest request, Callable<?> task, Throwable throwable) {
    cancelTask();//from  w  ww.j a  v  a  2  s  . c o m
    for (CallableProcessingInterceptor interceptor : this.interceptors) {
        try {
            Object result = interceptor.handleError(request, task, throwable);
            if (result == CallableProcessingInterceptor.RESPONSE_HANDLED) {
                break;
            } else if (result != CallableProcessingInterceptor.RESULT_NONE) {
                return result;
            }
        } catch (Throwable t) {
            return t;
        }
    }
    return CallableProcessingInterceptor.RESULT_NONE;
}