Class ErrorInfo

  • All Implemented Interfaces:
    Serializable

    public class ErrorInfo
    extends Object
    implements Serializable
    Contains information about an error. All members of this class are allowed to be null.
    Author:
    Jens Riemschneider
    See Also:
    Serialized Form
    • Constructor Detail

      • ErrorInfo

        public ErrorInfo()
        Constructs an error info.
      • ErrorInfo

        public ErrorInfo​(ErrorCode errorCode,
                         String codeContext,
                         Severity severity,
                         String location,
                         String customErrorCode)
        Constructs an error info.
        Parameters:
        errorCode - the error that occurred.
        codeContext - the context in which the error occurred.
        severity - the severity of the error.
        location - the location in which the error occurred.
        customErrorCode - user-defined error code for the cases when the errorCode parameter equals to ErrorCode._USER_DEFINED, otherwise will be ignored.
      • ErrorInfo

        public ErrorInfo​(Throwable throwable,
                         ErrorCode defaultMetaDataError,
                         ErrorCode defaultError,
                         String defaultLocation)
        Constructs an error info from the given exception.
        Parameters:
        throwable - the exception that occurred.
        defaultMetaDataError - the default error code for XDSMetaDataException.
        defaultError - the default error code for any other exception.
        defaultLocation - default error location.
    • Method Detail

      • getErrorCode

        public ErrorCode getErrorCode()
        Returns:
        the error that occurred.
      • setErrorCode

        public void setErrorCode​(ErrorCode errorCode)
        Parameters:
        errorCode - the error that occurred.
      • getCodeContext

        public String getCodeContext()
        Returns:
        the context in which the error occurred.
      • setCodeContext

        public void setCodeContext​(String codeContext)
        Parameters:
        codeContext - the context in which the error occurred.
      • getSeverity

        public Severity getSeverity()
        Returns:
        the severity of the error.
      • setSeverity

        public void setSeverity​(Severity severity)
        Parameters:
        severity - the severity of the error.
      • getLocation

        public String getLocation()
        Returns:
        the location in which the error occurred.
      • setLocation

        public void setLocation​(String location)
        Parameters:
        location - the location in which the error occurred.
      • getCustomErrorCode

        public String getCustomErrorCode()
        Returns:
        custom error code, if any set.
      • setCustomErrorCode

        public void setCustomErrorCode​(String customErrorCode)
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object