Class AttachmentValidationException

  • All Implemented Interfaces:
    Serializable

    @Unstable
    public class AttachmentValidationException
    extends Exception
    Exception thrown in case of error while validating an attachment. This exception also provides additional accessors to localize the error messages.
    Since:
    14.10
    Version:
    $Id: a40e0108e8db6a498f03f5910e07f2ed641086f4 $
    See Also:
    Serialized Form
    • Constructor Detail

      • AttachmentValidationException

        public AttachmentValidationException​(String message,
                                             int httpStatus,
                                             String translationKey,
                                             String contextMessage)
        Construct a new exception with the specified detail message.
        Parameters:
        message - The detailed message. This can later be retrieved by the Throwable.getMessage() method
        httpStatus - the http status to return when this exception is caught
        translationKey - the translation key to use when localizing this error
        contextMessage - the context message to use for this error
      • AttachmentValidationException

        public AttachmentValidationException​(String message,
                                             int httpStatus,
                                             String translationKey,
                                             List<Object> translationParameters,
                                             String contextMessage)
        Construct a new exception with the specific error message, the http status corresponding to this error, a translation key to localization this error and its parameters.
        Parameters:
        message - The detailed message. This can later be retrieved by the Throwable.getMessage() method
        httpStatus - the http status to return when this exception is caught
        translationKey - the translation key to use when localizing this error
        translationParameters - the translation parameters to use when localizing this error
        contextMessage - the context message to use for this error
      • AttachmentValidationException

        public AttachmentValidationException​(String message,
                                             int httpStatus,
                                             String translationKey)
        Construct a new exception with a message, an http status and a translation key.
        Parameters:
        message - the error message
        httpStatus - the http status
        translationKey - the translation key
      • AttachmentValidationException

        public AttachmentValidationException​(String message,
                                             Throwable cause,
                                             int httpStatus,
                                             String translationKey)
        Contruct a new exception with a message and a cause, plus an http status and a translation key.
        Parameters:
        message - the error message
        cause - the exception cause
        httpStatus - the http status
        translationKey - the translation key
    • Method Detail

      • getHttpStatus

        public int getHttpStatus()
        Returns:
        the http status to return when this exception is caught
      • getTranslationKey

        public String getTranslationKey()
        Returns:
        the translation key to use when localizing this error
      • getContextMessage

        public String getContextMessage()
        Returns:
        the context message to use for this error
      • getTranslationParameters

        public List<Object> getTranslationParameters()
        Returns:
        the parameters to use when translating this message