summaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit.http.server
diff options
context:
space:
mode:
authorDave Borowitz <dborowitz@google.com>2015-07-01 11:24:25 -0700
committerDave Borowitz <dborowitz@google.com>2015-07-09 11:41:24 -0700
commit6e4e34bb9e0620f00a820457705a0df60a1bd9c2 (patch)
treefbd8e6094d719d47036d12bb024336224cef34e3 /org.eclipse.jgit.http.server
parenta643aaaa4a19bf92f33ac57a29e59db9fb3e1a1f (diff)
downloadjgit-6e4e34bb9e0620f00a820457705a0df60a1bd9c2.tar.gz
jgit-6e4e34bb9e0620f00a820457705a0df60a1bd9c2.zip
Report PackProtocolExceptions to client during receive-pack
We have done this since forever with the "wanted old new ref" error, so let's do it for other such errors thrown in the same block as well. Change-Id: Ib3b1c7f05e31a5b3e40e85eb07b16736920a033b
Diffstat (limited to 'org.eclipse.jgit.http.server')
-rw-r--r--org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/ReceivePackServlet.java3
1 files changed, 2 insertions, 1 deletions
diff --git a/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/ReceivePackServlet.java b/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/ReceivePackServlet.java
index 41217d9971..c88670ec97 100644
--- a/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/ReceivePackServlet.java
+++ b/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/ReceivePackServlet.java
@@ -76,6 +76,7 @@ import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.eclipse.jgit.errors.CorruptObjectException;
+import org.eclipse.jgit.errors.PackProtocolException;
import org.eclipse.jgit.errors.UnpackException;
import org.eclipse.jgit.lib.Repository;
import org.eclipse.jgit.transport.InternalHttpServerGlue;
@@ -200,7 +201,7 @@ class ReceivePackServlet extends HttpServlet {
consumeRequestBody(req);
out.close();
- } catch (UnpackException e) {
+ } catch (UnpackException | PackProtocolException e) {
// This should be already reported to the client.
log(rp.getRepository(), e.getCause());
consumeRequestBody(req);