]> source.dussan.org Git - jgit.git/commit
Push errors back over sideband when possible 58/3558/2
authorShawn O. Pearce <spearce@spearce.org>
Fri, 27 May 2011 20:35:18 +0000 (13:35 -0700)
committerShawn O. Pearce <spearce@spearce.org>
Fri, 10 Jun 2011 00:29:46 +0000 (17:29 -0700)
commit7ff6eb584cf8b83f83a3b5edf897feb53dbf42c0
treebcee711b89ef4e348c8ce977323c3baf7e49f44a
parent1a87a725be28cb33f370bb62db69ae672a64c56b
Push errors back over sideband when possible

If an internal exception occurs while packing and the request
needs to abort, the HTTP response might already be committed due
to progress message having already been delivered to the client.
This prevents UploadPackServlet from resetting the response and
sending back an HTTP 500 response.

Try to catch all exceptions and report internal errors over the
sideband stream or as an ERR command during the initial ACK/NAK
negotiation phase. This allows JGit to transmit an error message
that the user will receive on their console without needing to
worry about resetting the (already gone) HTTP response.

Change-Id: Ie393fb8bb55d2b79ab1276adf71c781c1807f9fe
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/ReceivePackServlet.java
org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/UploadPackServlet.java
org.eclipse.jgit/resources/org/eclipse/jgit/JGitText.properties
org.eclipse.jgit/src/org/eclipse/jgit/JGitText.java
org.eclipse.jgit/src/org/eclipse/jgit/transport/UploadPack.java
org.eclipse.jgit/src/org/eclipse/jgit/transport/UploadPackInternalServerErrorException.java [new file with mode: 0644]