Class HpccError


  • public class HpccError
    extends Object
    Contains an error message together with (potentially) quite a lot of meta data about it.

    The HpccError is part generic (errorCode, errorType) and part entwined with default parsing of errors as they are presented by ECL

    At error creation time it can (and should) be treated as a bag of data. At use time there are various formatting options embedded within the class.

    • Constructor Detail

      • HpccError

        public HpccError​(HpccErrorLevel errlevel,
                         IErrorType errType,
                         IErrorCode constraintViolated,
                         String errorString)
        Instantiates a new hpcc error.
        Parameters:
        errlevel - - the Error Level of the error
        errType - - the error type of the error
        constraintViolated - - the error code
        errorString - - error message
      • HpccError

        public HpccError​(HpccErrorLevel errlevel,
                         IErrorType errType,
                         IErrorCode constraintViolated,
                         String errorString,
                         Exception ex)
        Instantiates a new hpcc error.
        Parameters:
        errlevel - - error level of the error (fatal, error, warning, info)
        errType - - error type
        constraintViolated - - error code
        errorString - - error message
        ex - - original exception thrown
      • HpccError

        public HpccError​(HpccErrorLevel errlevel,
                         IErrorType errType,
                         IErrorCode errCode,
                         String errorString,
                         String additional,
                         Integer lineNum,
                         Integer colNum,
                         String filename)
        Instantiates a new hpcc error.
        Parameters:
        errlevel - The Error Level of the error (FATAL,ERROR,WARNING,INFO)
        errType - The Type of error (SYSTEM,VALIDATE,etc)
        errCode - The ErrorCode of the Error
        errorString - The Error Message
        additional - any additional info
        lineNum - the line the error occurred on
        colNum - the column the error occurred at
        filename - the filename the error occurred in
    • Method Detail

      • toEclIdeString

        public String toEclIdeString()
        To ecl ide string.
        Returns:
        the Error in ECL IDE Error String format expected by ECL IDE filename(linenum,colnum):ErrorLevel ErrorCode.getNumVal():Error String
      • getSourceID

        public String getSourceID()
        Gets the source ID.
        Returns:
        the Unique Identifier of the object that caused this error
      • setSourceID

        public void setSourceID​(String sourceID)
        Sets the source ID.
        Parameters:
        sourceID - the unique Identifier of the object that caused this error
      • getErrorCode

        public IErrorCode getErrorCode()
        Gets the error code.
        Returns:
        the Error Code of this Error
      • getErrorString

        public String getErrorString()
        Gets the error string.
        Returns:
        the Error message of this error
      • getLineNum

        public Integer getLineNum()
        Gets the line num.
        Returns:
        The Line Number this error occurred at
      • setLineNum

        public void setLineNum​(int l)
        Sets the line num.
        Parameters:
        l - Set the line number this error occurred at
      • getColNum

        public Integer getColNum()
        Gets the col num.
        Returns:
        the Column Number this error occurred at
      • setColNum

        public void setColNum​(int c)
        Sets the col num.
        Parameters:
        c - the Column Number this error occurred at
      • getFilename

        public String getFilename()
        Gets the filename.
        Returns:
        The Filename of the file this error occurred in
      • setFilename

        public void setFilename​(String filename)
        Sets the filename.
        Parameters:
        filename - the Filename of the file this error occurred in
      • setErrorSource

        public void setErrorSource​(IErrorSource val)
        Sets the error source.
        Parameters:
        val - the Source of this object (Composition, Contract, Kel file, etc)
      • getErrorSource

        public IErrorSource getErrorSource()
        Gets the error source.
        Returns:
        the Source of this error (Composition, Contract, Kel , etc)
      • getErrorType

        public IErrorType getErrorType()
        Gets the error type.
        Returns:
        the Type of error: VALIDATE, SYSTEM, HPCC, etc. Class must extend IErrorType
      • setErrorType

        public void setErrorType​(IErrorType val)
        Sets the error type.
        Parameters:
        val - the Type of error: VALIDATE, SYSTEM, HPCC, etc. Class must extend IErrorType
      • getAdditionalInfo

        public String getAdditionalInfo()
        Gets the additional info.
        Returns:
        any additional info for this exception
      • setAdditionalInfo

        public void setAdditionalInfo​(String info)
        Sets the additional info.
        Parameters:
        info - any additional info for this exception
      • getErrorLevel

        public HpccErrorLevel getErrorLevel()
        Gets the error level.
        Returns:
        Error Level (FATAL, ERROR, WARNING, INFO)
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object
      • getException

        public Exception getException()
        Gets the exception.
        Returns:
        the exception
      • setException

        public void setException​(Exception ex)
        Sets the exception.
        Parameters:
        ex - the new exception