mirror of
https://github.com/gyurix1968/guacamole-client.git
synced 2025-09-06 05:07:41 +00:00
GUACAMOLE-504: Avoid unnecessary use of instanceof.
This commit is contained in:
@@ -259,18 +259,16 @@ public abstract class GuacamoleHTTPTunnelServlet extends HttpServlet {
|
|||||||
|
|
||||||
// Catch any thrown guacamole exception and attempt to pass within the
|
// Catch any thrown guacamole exception and attempt to pass within the
|
||||||
// HTTP response, logging each error appropriately.
|
// HTTP response, logging each error appropriately.
|
||||||
|
catch (GuacamoleClientException e) {
|
||||||
|
logger.warn("HTTP tunnel request rejected: {}", e.getMessage());
|
||||||
|
sendError(response, e.getStatus().getGuacamoleStatusCode(),
|
||||||
|
e.getStatus().getHttpStatusCode(), e.getMessage());
|
||||||
|
}
|
||||||
catch (GuacamoleException e) {
|
catch (GuacamoleException e) {
|
||||||
if (e instanceof GuacamoleClientException) {
|
logger.error("HTTP tunnel request failed: {}", e.getMessage());
|
||||||
logger.warn("HTTP tunnel request rejected: {}", e.getMessage());
|
logger.debug("Internal error in HTTP tunnel.", e);
|
||||||
sendError(response, e.getStatus().getGuacamoleStatusCode(),
|
sendError(response, e.getStatus().getGuacamoleStatusCode(),
|
||||||
e.getStatus().getHttpStatusCode(), e.getMessage());
|
e.getStatus().getHttpStatusCode(), "Internal server error.");
|
||||||
}
|
|
||||||
else {
|
|
||||||
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.");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user