class ExampleErrorForwardHandler implements Handler<Object, Object> {

    @Override
    public Object handle(Object data, ExecutionContext context) {

        try {
            // 後続の業務アクションハンドラが送出した例外をtry-catch文で捕捉する
            return context.handleNext(data);
        } catch (SessionKeyNotFoundException e) {
            throw new HttpErrorResponse(HttpResponse.Status.BAD_REQUEST.getStatusCode(),
                    "/WEB-INF/view/common/errorPages/doubleSubmissionError.jsp", e);
        } catch (NoDataException e) {
            throw new HttpErrorResponse(HttpResponse.Status.NOT_FOUND.getStatusCode(),
                    "/WEB-INF/view/common/errorPages/pageNotFoundError.jsp", e);
        } catch (OptimisticLockException e) {
            throw new HttpErrorResponse(HttpResponse.Status.BAD_REQUEST.getStatusCode(),
                    "/WEB-INF/view/common/errorPages/optimisticLockError.jsp", e);
        } catch (TemporaryFileFailedException e) {
            FailureLogUtil.logFatal(e, context.getDataProcessedWhenThrown(e), null);
            throw new HttpErrorResponse(HttpResponse.Status.INTERNAL_SERVER_ERROR.getStatusCode(), e);
        }
    }

}