Generic error messages from status codes.
authorMichael Jumper <zhangmaike@users.sourceforge.net>
Sun, 25 Mar 2012 02:13:32 +0000 (19:13 -0700)
committerMichael Jumper <zhangmaike@users.sourceforge.net>
Sun, 25 Mar 2012 02:13:32 +0000 (19:13 -0700)
src/main/resources/tunnel.js

index f44110d..a06c2b4 100644 (file)
@@ -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";
 
     }