Class ExceptionMapper<X extends Exception>

    • Constructor Detail

      • ExceptionMapper

        public ExceptionMapper​(String opName,
                               Class<X> exceptionType)
        Constructor.
        Parameters:
        opName - the String prefix for exception messages.
        exceptionType - the exception type to which to translate.
    • Method Detail

      • getExceptionType

        protected final Class<X> getExceptionType()
        Return the exception class produced by this instance.
        Returns:
        Exception class.
      • newWithCause

        protected abstract X newWithCause​(String message,
                                          Throwable cause)
        Invoked to create a new exception instance of the specified type.
        Parameters:
        message - the message for the new exception.
        cause - the cause for the new exception.
        Returns:
        an instance of the exception type.