Add constructors that take Throwable to ServiceMayNotContinueException.

ServiceMayNotContinueException usually wraps an underlying exception.
Add convenience constructors that take Throwable. In the case a
string is not provided, the message defaults to "internal server error",
since it may be reported to the client.

Change-Id: I15dc20306826c352f69e88afb7ed6927c12b6c1f
This commit is contained in:
Colby Ranger 2013-10-07 14:14:01 -07:00
parent 5218f7b33a
commit a27529c822
1 changed files with 23 additions and 0 deletions

View File

@ -45,6 +45,8 @@
import java.io.IOException;
import org.eclipse.jgit.internal.JGitText;
/**
* Indicates a transport service may not continue execution.
*
@ -69,6 +71,27 @@ public ServiceMayNotContinueException(String msg) {
super(msg);
}
/**
* @param msg
* a message explaining why it cannot continue. This message may
* be shown to an end-user.
* @param cause
* the cause of the exception.
*/
public ServiceMayNotContinueException(String msg, Throwable cause) {
super(msg, cause);
}
/**
* Initialize with an "internal server error" message and a cause.
*
* @param cause
* the cause of the exception.
*/
public ServiceMayNotContinueException(Throwable cause) {
super(JGitText.get().internalServerError, cause);
}
/** @return true if the message was already output to the client. */
public boolean isOutput() {
return output;