From 6cb50bd4f8ea47ec1f2fb6ff79c6aceeb83c84e0 Mon Sep 17 00:00:00 2001 From: Nick Couchman Date: Wed, 30 May 2018 06:27:21 -0400 Subject: [PATCH] GUACAMOLE-566: Minor style cleanups; use APIError for unhandled exceptions. --- .../java/org/apache/guacamole/rest/RESTExceptionMapper.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/guacamole/src/main/java/org/apache/guacamole/rest/RESTExceptionMapper.java b/guacamole/src/main/java/org/apache/guacamole/rest/RESTExceptionMapper.java index ae352747b..931408d6f 100644 --- a/guacamole/src/main/java/org/apache/guacamole/rest/RESTExceptionMapper.java +++ b/guacamole/src/main/java/org/apache/guacamole/rest/RESTExceptionMapper.java @@ -92,7 +92,7 @@ public class RESTExceptionMapper implements ExceptionMapper { if (t instanceof GuacamoleException) return Response .status(((GuacamoleException) t).getHttpStatusCode()) - .entity(new APIError((GuacamoleException)t)) + .entity(new APIError((GuacamoleException) t)) .type(MediaType.APPLICATION_JSON) .build(); @@ -109,7 +109,8 @@ public class RESTExceptionMapper implements ExceptionMapper { return Response .status(Response.Status.INTERNAL_SERVER_ERROR) - .entity("Unexpected Internal Error.") + .entity(new APIError( + new GuacamoleException("Unexpected internal error", t))) .type(MediaType.APPLICATION_JSON) .build();