GUACAMOLE-566: Minor style cleanups; use APIError for unhandled exceptions.

This commit is contained in:
Nick Couchman
2018-05-30 06:27:21 -04:00
parent 383a71723a
commit 6cb50bd4f8

View File

@@ -92,7 +92,7 @@ public class RESTExceptionMapper implements ExceptionMapper<Throwable> {
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<Throwable> {
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();