|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.lang.Throwable
java.lang.Exception
at.knowcenter.wag.egov.egiz.exceptions.PresentableException
at.knowcenter.wag.egov.egiz.exceptions.ErrorCodeException
public class ErrorCodeException
This exception should be inherit, if an exception should be shown as a feedback message in user interfaces.
The error code is an integer number. The error codes are defined in an separate configuration file, readed be the SettingsReader. If the SettingsReader can not initialized, a corresponding error message can not read!
The error code can be seen a a replacement of the exception message. For all intents and purposes, the error code should be used to provide exceptional feedback to the user. Nevertheless, if possible, a debug message String (the message parameter) should still be provided giving in depth developer descriptions of the problem. These message strings will then show up in the log files accordingly.
SettingsReader
,
Serialized FormConstructor Summary | |
---|---|
ErrorCodeException(int error_code)
Constructor that sets the error code. |
|
ErrorCodeException(int error_code,
String message)
Inherit Constructor from Exception, |
|
ErrorCodeException(int error_code,
String message,
Throwable cause)
Inherit Constructor from Exception, |
|
ErrorCodeException(int error_code,
Throwable cause)
Inherit Constructor from Exception, |
Method Summary | |
---|---|
int |
getErrorCode()
Return the manually stored error code. |
String |
getErrorCodeMessage()
Get the configured error message that corresponds to the error code. |
static String |
getErrorCodeMessage(int errorCode)
Get the configured error message that corresponds to the given error code. |
String |
getExternalErrorCode()
Returns an external error code that is set manually |
String |
getExternalErrorMessage()
Returns an external error message that is set manually |
boolean |
hasErrorCode()
Checks if the exception has an ErrorCode state. |
boolean |
hasExternalErrorMessage()
Checks if an external error message is set. |
void |
setErrorCode(int error_code)
Set a special error code in case of commuicating this error in an user interface. |
void |
setExternalErrorCode(String errorCode)
Set a special error code in case of commuicating this error in an user interface. |
void |
setExternalErrorMessage(String errorMessage)
Set a special error message in case of commuicating this error in an user interface. |
Methods inherited from class java.lang.Throwable |
---|
fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public ErrorCodeException(int error_code)
error_code
- The error code.public ErrorCodeException(int error_code, String message)
error_code
- The error code.message
- The in depth developer provided error message.Exception
public ErrorCodeException(int error_code, String message, Throwable cause)
error_code
- The error code.message
- The in depth developer provided error message.cause
- The cause of this exception.Exception
public ErrorCodeException(int error_code, Throwable cause)
error_code
- The error code.cause
- The cause of this exception.Exception
Method Detail |
---|
public int getErrorCode()
SettingsReader
public void setErrorCode(int error_code)
error_code
- The error code to be set.SettingsReader
public void setExternalErrorCode(String errorCode)
errorCode
- The errorCode to set.public String getExternalErrorCode()
null
otherwisepublic void setExternalErrorMessage(String errorMessage)
errorMessage
- public String getExternalErrorMessage()
null
otherwisepublic boolean hasExternalErrorMessage()
true
if a message is set, false
otherwisepublic String getErrorCodeMessage()
public static String getErrorCodeMessage(int errorCode)
public boolean hasErrorCode()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |