From 9ed5916734d34c46408260ba2265774ff1520589 Mon Sep 17 00:00:00 2001 From: Michael Jumper Date: Sat, 24 Mar 2012 19:13:32 -0700 Subject: [PATCH] Generic error messages from status codes. --- src/main/resources/tunnel.js | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/main/resources/tunnel.js b/src/main/resources/tunnel.js index f44110d..a06c2b4 100644 --- a/src/main/resources/tunnel.js +++ b/src/main/resources/tunnel.js @@ -207,10 +207,15 @@ Guacamole.HTTPTunnel = function(tunnelURL) { var status = xmlhttprequest.status; - if (status >= 200 && status <= 299) return "Success"; - if (status >= 400 && status <= 499) return "Unauthorized"; - if (status >= 500 && status <= 599) return "Connection lost"; + // Special cases + if (status == 200) return "Success"; + if (status == 403) return "Unauthorized"; + if (status == 404) return "Connection does not exist"; + // Internal server errors + if (status >= 500 && status <= 599) return "Server error"; + + // Otherwise, unknown return "Unknown error"; } -- 1.7.10.4