RepositoryExceptionpublic class RepositoryException extends Exception
Fields Summary |
---|
private final String | PREFIX | private final String | POSTFIX |
Constructors Summary |
---|
public RepositoryException(String message)Constructs a new InstanceException object.
super(message);
| public RepositoryException(Throwable cause)Constructs a new InstanceException object.
//When created without a message, we take the message of our cause
this(cause.getLocalizedMessage(), cause);
| public RepositoryException(String message, Throwable cause)Constructs a new InstanceException object.
super(message, cause);
|
Methods Summary |
---|
private java.lang.String | format(java.lang.String msg, java.lang.String causeMsg, java.lang.Throwable cause)
if (cause != null) {
if (msg != null) {
if (causeMsg != null) {
msg = causeMsg;
} else {
msg = cause.toString();
}
} else if (causeMsg != null && !causeMsg.equals(msg)) {
msg += PREFIX + causeMsg + POSTFIX;
} else if (causeMsg == null) {
msg += PREFIX + cause.toString() + POSTFIX;
}
}
return msg;
| public java.lang.String | getLocalizedMessage()If there is a cause, appends the getCause().getMessage()
to the original message.
String msg = super.getLocalizedMessage();
Throwable cause = super.getCause();
if (cause != null) {
msg = format(msg, cause.getLocalizedMessage(), cause);
}
return msg;
| public java.lang.String | getMessage()If there is a cause, appends the getCause().getMessage()
to the original message.
String msg = super.getMessage();
Throwable cause = super.getCause();
if (cause != null) {
msg = format(msg, cause.getMessage(), cause);
}
return msg;
|
|