jgit/org.eclipse.jgit.lfs
David Pursehouse 571c9f5fd6 LfsProtocolServlet: Allow getLargeFileRepository to raise exceptions
According to the specification [1] the server may return the following
HTTP error responses:

- 403: The user has read, but not write access.
- 404: The repository does not exist for the user.
- 422: Validation error with one or more of the objects in the request.

In the current implementation, however, getLargeFileRepository can only
return null to indicate an error. This results in the error code:

- 503: Service Unavailable

being returned to the client regardless of what the actual reason was.

Add exception classes to cover these cases, derived from a common base
exception, and change the specification of getLargeFileRepository to throw
the base exception.

In LfsProtocolServlet#post, handle the new exceptions and send back the
appropriate HTTP responses as mentioned above.

The specification also mentions several other optional response codes (406,
429, 501, and 509) but these are not implemented in this commit. It should
be trivial to implement them in follow-up commits.

[1] https://github.com/github/git-lfs/blob/master/docs/api/v1/http-v1-batch.md#response-errors

Change-Id: I91be6165bcaf856d0cefc533882330962e2fc9b2
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
2016-08-05 11:22:27 +09:00
..
.settings Ignore 'The value of exception parameter is not used' warning 2016-07-26 10:16:49 +09:00
META-INF Prepare 4.5.0-SNAPSHOT builds 2016-06-01 23:04:07 +02:00
resources/org/eclipse/jgit/lfs/internal Implement SHA-256 abstraction 2016-02-04 17:49:42 +01:00
src/org/eclipse/jgit/lfs LfsProtocolServlet: Allow getLargeFileRepository to raise exceptions 2016-08-05 11:22:27 +09:00
.classpath Implement SHA-256 abstraction 2016-02-04 17:49:42 +01:00
.fbprefs Implement SHA-256 abstraction 2016-02-04 17:49:42 +01:00
.gitignore Implement SHA-256 abstraction 2016-02-04 17:49:42 +01:00
.project Implement SHA-256 abstraction 2016-02-04 17:49:42 +01:00
BUCK Implement SHA-256 abstraction 2016-02-04 17:49:42 +01:00
about.html Implement SHA-256 abstraction 2016-02-04 17:49:42 +01:00
build.properties Implement SHA-256 abstraction 2016-02-04 17:49:42 +01:00
plugin.properties Implement SHA-256 abstraction 2016-02-04 17:49:42 +01:00
pom.xml Prepare 4.5.0-SNAPSHOT builds 2016-06-01 23:04:07 +02:00