Errors thrown by connect() of a chained tunnel should be resent to onerror() if caugh...
[guacamole-common-js.git] / src / main / resources / tunnel.js
index 5b5a167..8729b8a 100644 (file)
@@ -729,8 +729,19 @@ Guacamole.ChainedTunnel = function(tunnel_chain) {
 
         };
 
-        // Attempt connection
-        current_tunnel.connect(connect_data);
+        try {
+            
+            // Attempt connection
+            current_tunnel.connect(connect_data);
+            
+        }
+        catch (e) {
+            
+            // Call error handler of current tunnel on error
+            current_tunnel.onerror(e.message);
+            
+        }
+
 
     }