From a27529c822ffae2b72048596370784f91e071a36 Mon Sep 17 00:00:00 2001 From: Colby Ranger Date: Mon, 7 Oct 2013 14:14:01 -0700 Subject: [PATCH] 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 --- .../ServiceMayNotContinueException.java | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/transport/ServiceMayNotContinueException.java b/org.eclipse.jgit/src/org/eclipse/jgit/transport/ServiceMayNotContinueException.java index 86f644682..fde23b3fa 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/ServiceMayNotContinueException.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/ServiceMayNotContinueException.java @@ -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;