Class ErrorInfo
java.lang.Object
org.openehealth.ipf.commons.ihe.xds.core.responses.ErrorInfo
- All Implemented Interfaces:
Serializable
Contains information about an error.
All members of this class are allowed to be
null
.- Author:
- Jens Riemschneider
- See Also:
-
Constructor Summary
ConstructorDescriptionConstructs an error info.ErrorInfo
(Throwable throwable, ErrorCode defaultMetaDataError, ErrorCode defaultError, String defaultLocation) Constructs an error info from the given exception.ErrorInfo
(ErrorCode errorCode, String codeContext, Severity severity, String location, String customErrorCode) Constructs an error info. -
Method Summary
Modifier and TypeMethodDescriptionboolean
int
hashCode()
void
setCodeContext
(String codeContext) void
setCustomErrorCode
(String customErrorCode) void
setErrorCode
(ErrorCode errorCode) void
setLocation
(String location) void
setSeverity
(Severity severity) toString()
-
Constructor Details
-
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 theerrorCode
parameter equals toErrorCode._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 forXDSMetaDataException
.defaultError
- the default error code for any other exception.defaultLocation
- default error location.
-
-
Method Details
-
getErrorCode
- Returns:
- the error that occurred.
-
setErrorCode
- Parameters:
errorCode
- the error that occurred.
-
getCodeContext
- Returns:
- the context in which the error occurred.
-
setCodeContext
- Parameters:
codeContext
- the context in which the error occurred.
-
getSeverity
- Returns:
- the severity of the error.
-
setSeverity
- Parameters:
severity
- the severity of the error.
-
getLocation
- Returns:
- the location in which the error occurred.
-
setLocation
- Parameters:
location
- the location in which the error occurred.
-
getCustomErrorCode
- Returns:
- custom error code, if any set.
-
setCustomErrorCode
-
hashCode
public int hashCode() -
equals
-
toString
-