class Xs2aRestExceptionHandler extends DefaultHandlerExceptionResolver {

    @Override
    protected ModelAndView doResolveException(HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex) {
        if (xs2aEndpointChecker.isXs2aEndpoint(request)) {
            return super.doResolveException(request, response, handler, ex);
        }
        return null;
    }

}