You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@guacamole.apache.org by mj...@apache.org on 2018/02/04 05:38:28 UTC
[1/2] guacamole-client git commit: GUACAMOLE-499: Have
RESTExceptionWrapper leverage HTTP status codes built into GuacamoleStatus.
Repository: guacamole-client
Updated Branches:
refs/heads/master e2e166d2d -> 6db253956
GUACAMOLE-499: Have RESTExceptionWrapper leverage HTTP status codes built into GuacamoleStatus.
Project: http://git-wip-us.apache.org/repos/asf/guacamole-client/repo
Commit: http://git-wip-us.apache.org/repos/asf/guacamole-client/commit/d8893529
Tree: http://git-wip-us.apache.org/repos/asf/guacamole-client/tree/d8893529
Diff: http://git-wip-us.apache.org/repos/asf/guacamole-client/diff/d8893529
Branch: refs/heads/master
Commit: d889352941e85880fecaa7f061fe0934b9e979f7
Parents: 6b0f310
Author: Nick Couchman <vn...@apache.org>
Authored: Sat Feb 3 23:29:59 2018 -0500
Committer: Nick Couchman <vn...@apache.org>
Committed: Sat Feb 3 23:33:52 2018 -0500
----------------------------------------------------------------------
.../apache/guacamole/rest/RESTExceptionWrapper.java | 14 ++++----------
1 file changed, 4 insertions(+), 10 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/guacamole-client/blob/d8893529/guacamole/src/main/java/org/apache/guacamole/rest/RESTExceptionWrapper.java
----------------------------------------------------------------------
diff --git a/guacamole/src/main/java/org/apache/guacamole/rest/RESTExceptionWrapper.java b/guacamole/src/main/java/org/apache/guacamole/rest/RESTExceptionWrapper.java
index 6f1ab37..28736e8 100644
--- a/guacamole/src/main/java/org/apache/guacamole/rest/RESTExceptionWrapper.java
+++ b/guacamole/src/main/java/org/apache/guacamole/rest/RESTExceptionWrapper.java
@@ -171,17 +171,11 @@ public class RESTExceptionWrapper implements MethodInterceptor {
}
// Translate GuacamoleException subclasses to HTTP error codes
- catch (GuacamoleSecurityException e) {
- throw new APIException(Response.Status.FORBIDDEN, e);
- }
- catch (GuacamoleResourceNotFoundException e) {
- throw new APIException(Response.Status.NOT_FOUND, e);
- }
- catch (GuacamoleClientException e) {
- throw new APIException(Response.Status.BAD_REQUEST, e);
- }
catch (GuacamoleException e) {
- throw new APIException(Response.Status.INTERNAL_SERVER_ERROR, e);
+ throw new APIException(
+ Response.Status.fromStatusCode(e.getStatus().getHttpStatusCode()),
+ e
+ );
}
// Rethrow unchecked exceptions such that they are properly wrapped
[2/2] guacamole-client git commit: GUACAMOLE-499: Merge
simplification of REST API error handling,
leveraging the status codes built into GuacamolException subclasses.
Posted by mj...@apache.org.
GUACAMOLE-499: Merge simplification of REST API error handling, leveraging the status codes built into GuacamolException subclasses.
Project: http://git-wip-us.apache.org/repos/asf/guacamole-client/repo
Commit: http://git-wip-us.apache.org/repos/asf/guacamole-client/commit/6db25395
Tree: http://git-wip-us.apache.org/repos/asf/guacamole-client/tree/6db25395
Diff: http://git-wip-us.apache.org/repos/asf/guacamole-client/diff/6db25395
Branch: refs/heads/master
Commit: 6db25395698632d93e766e73ec73437eb262b5a3
Parents: e2e166d d889352
Author: Michael Jumper <mj...@apache.org>
Authored: Sat Feb 3 21:35:54 2018 -0800
Committer: Michael Jumper <mj...@apache.org>
Committed: Sat Feb 3 21:35:54 2018 -0800
----------------------------------------------------------------------
.../apache/guacamole/rest/RESTExceptionWrapper.java | 14 ++++----------
1 file changed, 4 insertions(+), 10 deletions(-)
----------------------------------------------------------------------