Class AttivioException

  • All Implemented Interfaces:
    AttivioThrowable, java.io.Serializable
    Direct Known Subclasses:
    TransportException

    @WebFault
    public class AttivioException
    extends java.lang.Exception
    implements AttivioThrowable
    The base class for general Attivio generated exceptions.

    Contains the underlying ErrorCode that may explain the cause of the exception.

    See Also:
    Serialized Form
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      protected AttivioException()  
        AttivioException​(ErrorCode code, java.lang.String message, java.lang.Object... params)
      Constructs an AttivioException with the error code.
        AttivioException​(ErrorCode code, java.lang.Throwable cause, java.lang.String message, java.lang.Object... params)
      Constructs an AttivioException with the error code.
        AttivioException​(java.lang.String context, ErrorCode code, java.lang.Throwable cause, java.lang.String message, java.lang.Object... params)
      Constructs an AttivioException with the error code.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean equals​(java.lang.Object other)
      static java.lang.String formatLogMessage​(java.lang.String msg, java.lang.Object... params)
      Safely formats a log message handling null input as well as returning a warning message if message formatting failed.
      ErrorCode getErrorCode()
      Get the ErrorCode for this exception.
      java.lang.String getErrorContext()
      Get the context for this error.
      java.lang.String getMessage()
      java.lang.String getOriginalMessage()
      Get the original message without ErrorCode.
      int hashCode()
      AttivioException toRemoteException()
      Convert this exception to be a remote exception.
      • Methods inherited from class java.lang.Throwable

        addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • AttivioException

        protected AttivioException()
      • AttivioException

        public AttivioException​(ErrorCode code,
                                java.lang.String message,
                                java.lang.Object... params)
        Constructs an AttivioException with the error code. Note: parameters are used as an argument to a String format on the message argument.
        Parameters:
        code - the error code
        message - the error message
        params - any error message parameters
      • AttivioException

        public AttivioException​(ErrorCode code,
                                java.lang.Throwable cause,
                                java.lang.String message,
                                java.lang.Object... params)
        Constructs an AttivioException with the error code. Note: parameters are used as an argument to a String format on the message argument.
        Parameters:
        code - the error code
        cause - the error cause
        message - the error message
        params - any error message parameters
      • AttivioException

        public AttivioException​(java.lang.String context,
                                ErrorCode code,
                                java.lang.Throwable cause,
                                java.lang.String message,
                                java.lang.Object... params)
        Constructs an AttivioException with the error code. Note: parameters are used as an argument to a String format on the message argument.
        Parameters:
        code - the error code
        context - the context for this error (field name, docid, etc)
        cause - the error cause
        message - the error message
        params - any error message parameters
    • Method Detail

      • getErrorContext

        public java.lang.String getErrorContext()
        Get the context for this error.

        This context is specific to the error code and will typically consist of things such as field names, document ids, etc.

        Specified by:
        getErrorContext in interface AttivioThrowable
      • getOriginalMessage

        public java.lang.String getOriginalMessage()
        Get the original message without ErrorCode.
        Specified by:
        getOriginalMessage in interface AttivioThrowable
      • getMessage

        public java.lang.String getMessage()
        Overrides:
        getMessage in class java.lang.Throwable
      • toRemoteException

        public AttivioException toRemoteException()
        Convert this exception to be a remote exception.

        This converts this exception to a representation that a client can receive.

        Specified by:
        toRemoteException in interface AttivioThrowable
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • equals

        public boolean equals​(java.lang.Object other)
        Overrides:
        equals in class java.lang.Object
      • formatLogMessage

        public static final java.lang.String formatLogMessage​(java.lang.String msg,
                                                              java.lang.Object... params)
        Safely formats a log message handling null input as well as returning a warning message if message formatting failed.