mirror of
https://github.com/gyurix1968/guacamole-client.git
synced 2025-09-06 13:17:41 +00:00
GUACAMOLE-504: Add method for WebSocket status, and reconfigure REST API to use new HTTP method.
This commit is contained in:
@@ -80,5 +80,17 @@ public class GuacamoleException extends Exception {
|
|||||||
public int getHttpStatusCode() {
|
public int getHttpStatusCode() {
|
||||||
return getStatus().getHttpStatusCode();
|
return getStatus().getHttpStatusCode();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the most applicable WebSocket status code that can be
|
||||||
|
* associated with this exception.
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
* An integer representing the most applicable WebSocket status
|
||||||
|
* code associated with this exception.
|
||||||
|
*/
|
||||||
|
public int getWebSocketCode() {
|
||||||
|
return getStatus().getWebSocketCode();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -173,7 +173,7 @@ public class RESTExceptionWrapper implements MethodInterceptor {
|
|||||||
// Translate GuacamoleException subclasses to HTTP error codes
|
// Translate GuacamoleException subclasses to HTTP error codes
|
||||||
catch (GuacamoleException e) {
|
catch (GuacamoleException e) {
|
||||||
throw new APIException(
|
throw new APIException(
|
||||||
Response.Status.fromStatusCode(e.getStatus().getHttpStatusCode()),
|
Response.Status.fromStatusCode(e.getHttpStatusCode()),
|
||||||
e
|
e
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user