GUACAMOLE-504: Avoid unnecessary use of instanceof.

This commit is contained in:
Nick Couchman
2018-02-10 14:41:37 -05:00
parent ebd897421d
commit e996a5a299

View File

@@ -259,19 +259,17 @@ public abstract class GuacamoleHTTPTunnelServlet extends HttpServlet {
// Catch any thrown guacamole exception and attempt to pass within the
// HTTP response, logging each error appropriately.
catch (GuacamoleException e) {
if (e instanceof GuacamoleClientException) {
catch (GuacamoleClientException e) {
logger.warn("HTTP tunnel request rejected: {}", e.getMessage());
sendError(response, e.getStatus().getGuacamoleStatusCode(),
e.getStatus().getHttpStatusCode(), e.getMessage());
}
else {
catch (GuacamoleException e) {
logger.error("HTTP tunnel request failed: {}", e.getMessage());
logger.debug("Internal error in HTTP tunnel.", e);
sendError(response, e.getStatus().getGuacamoleStatusCode(),
e.getStatus().getHttpStatusCode(), "Internal server error.");
}
}
}