@ExceptionHandler(AbstractServerRtException.class)
    public ResponseEntity<ExceptionInfo> handleSpServerRtExceptions(final HttpServletRequest request,
            final Exception ex) {
        logRequest(request, ex);
        final ExceptionInfo response = createExceptionInfo(ex);
        final HttpStatus responseStatus;
        if (ex instanceof AbstractServerRtException) {
            responseStatus = getStatusOrDefault(((AbstractServerRtException) ex).getError());
        } else {
            responseStatus = DEFAULT_RESPONSE_STATUS;
        }
        return new ResponseEntity<>(response, responseStatus);
    }
@ ExceptionHandler ( AbstractServerRtException . class ) public ResponseEntity < ExceptionInfo > handleSpServerRtExceptions ( final HttpServletRequest request , final Exception ex ) { logRequest ( request , ex ) ; final ExceptionInfo response = createExceptionInfo ( ex ) ; final HttpStatus responseStatus ; if ( ex instanceof AbstractServerRtException ) { responseStatus = getStatusOrDefault ( ( ( AbstractServerRtException ) ex ) . getError ( ) ) ; } else { responseStatus = DEFAULT_RESPONSE_STATUS ; } return new ResponseEntity < > ( response , responseStatus ) ; }
method for handling exception of type AbstractServerRtException. Called
by the Spring-Framework for exception handling.

@param request
the Http request
@param ex
the exception which occurred

@return the entity to be responded containing the exception information
as entity.