mirror of
https://github.com/gyurix1968/guacamole-client.git
synced 2025-09-07 05:31:22 +00:00
GUACAMOLE-566: Minor style cleanups; use APIError for unhandled exceptions.
This commit is contained in:
@@ -92,7 +92,7 @@ public class RESTExceptionMapper implements ExceptionMapper<Throwable> {
|
|||||||
if (t instanceof GuacamoleException)
|
if (t instanceof GuacamoleException)
|
||||||
return Response
|
return Response
|
||||||
.status(((GuacamoleException) t).getHttpStatusCode())
|
.status(((GuacamoleException) t).getHttpStatusCode())
|
||||||
.entity(new APIError((GuacamoleException)t))
|
.entity(new APIError((GuacamoleException) t))
|
||||||
.type(MediaType.APPLICATION_JSON)
|
.type(MediaType.APPLICATION_JSON)
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
@@ -109,7 +109,8 @@ public class RESTExceptionMapper implements ExceptionMapper<Throwable> {
|
|||||||
|
|
||||||
return Response
|
return Response
|
||||||
.status(Response.Status.INTERNAL_SERVER_ERROR)
|
.status(Response.Status.INTERNAL_SERVER_ERROR)
|
||||||
.entity("Unexpected Internal Error.")
|
.entity(new APIError(
|
||||||
|
new GuacamoleException("Unexpected internal error", t)))
|
||||||
.type(MediaType.APPLICATION_JSON)
|
.type(MediaType.APPLICATION_JSON)
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user