code: protected Response toResponse(Throwable exception, Throwable catched) {
  
      if (exception instanceof ValidationException) {
        return handleValidationException(exception, catched);
      } else if (exception instanceof ValidationErrorUserException) {
        return createResponse(exception, (ValidationErrorUserException) exception, null);
      } else {
        Class<?> exceptionClass = exception.getClass();
        for (Class<?> securityError : this.securityExceptions) {
          if (securityError.isAssignableFrom(exceptionClass)) {
            return handleSecurityError(exception, catched);
          }
        }
        return handleGenericError(exception, catched);
      }
    }
docs: @see #toResponse(Throwable)
  
  @param exception the exception to handle
  @param catched the original exception that was cached. Either same as {@code error} or a (child-)
  {@link Throwable#getCause() cause} of it.
  @return the response build from the exception.