Browse Source

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
stable-3.2
Colby Ranger 11 years ago
parent
commit
a27529c822
  1. 23
      org.eclipse.jgit/src/org/eclipse/jgit/transport/ServiceMayNotContinueException.java

23
org.eclipse.jgit/src/org/eclipse/jgit/transport/ServiceMayNotContinueException.java

@ -45,6 +45,8 @@ package org.eclipse.jgit.transport;
import java.io.IOException;
import org.eclipse.jgit.internal.JGitText;
/**
* Indicates a transport service may not continue execution.
*
@ -69,6 +71,27 @@ public class ServiceMayNotContinueException extends IOException {
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;

Loading…
Cancel
Save