Package org.hpccsystems.commons.errors
Class HpccError
- java.lang.Object
-
- org.hpccsystems.commons.errors.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 Summary
Constructors Constructor Description HpccError(HpccErrorLevel errlevel, IErrorType errType, IErrorCode constraintViolated, String errorString)
Instantiates a new hpcc error.HpccError(HpccErrorLevel errlevel, IErrorType errType, IErrorCode constraintViolated, String errorString, Exception ex)
Instantiates a new hpcc error.HpccError(HpccErrorLevel errlevel, IErrorType errType, IErrorCode errCode, String errorString, String additional, Integer lineNum, Integer colNum, String filename)
Instantiates a new hpcc error.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object o)
String
getAdditionalInfo()
Gets the additional info.Integer
getColNum()
Gets the col num.IErrorCode
getErrorCode()
Gets the error code.HpccErrorLevel
getErrorLevel()
Gets the error level.IErrorSource
getErrorSource()
Gets the error source.String
getErrorString()
Gets the error string.IErrorType
getErrorType()
Gets the error type.Exception
getException()
Gets the exception.String
getFilename()
Gets the filename.Integer
getLineNum()
Gets the line num.String
getSourceID()
Gets the source ID.int
hashCode()
void
setAdditionalInfo(String info)
Sets the additional info.void
setColNum(int c)
Sets the col num.void
setErrorSource(IErrorSource val)
Sets the error source.void
setErrorType(IErrorType val)
Sets the error type.void
setException(Exception ex)
Sets the exception.void
setFilename(String filename)
Sets the filename.void
setLineNum(int l)
Sets the line num.void
setSourceID(String sourceID)
Sets the source ID.String
toEclIdeString()
To ecl ide string.String
toString()
-
-
-
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 errorerrType
- - the error type of the errorconstraintViolated
- - the error codeerrorString
- - 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 typeconstraintViolated
- - error codeerrorString
- - error messageex
- - 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 ErrorerrorString
- The Error Messageadditional
- any additional infolineNum
- the line the error occurred oncolNum
- the column the error occurred atfilename
- 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)
-
getException
public Exception getException()
Gets the exception.- Returns:
- the exception
-
setException
public void setException(Exception ex)
Sets the exception.- Parameters:
ex
- the new exception
-
-