From 6d4a83ce3376f77ff2ad8bb5eb3ad6ab577d00c4 Mon Sep 17 00:00:00 2001 From: Michael Jumper Date: Fri, 21 Mar 2014 19:46:01 -0700 Subject: [PATCH] GUAC-558: Add separate error strings for tunnel errors. --- guacamole/src/main/webapp/client.xhtml | 2 +- .../src/main/webapp/scripts/client-ui.js | 52 +++++++++++++++++-- 2 files changed, 50 insertions(+), 4 deletions(-) diff --git a/guacamole/src/main/webapp/client.xhtml b/guacamole/src/main/webapp/client.xhtml index d5c42bb99..417712d3b 100644 --- a/guacamole/src/main/webapp/client.xhtml +++ b/guacamole/src/main/webapp/client.xhtml @@ -137,7 +137,7 @@ // Show connection errors from tunnel tunnel.onerror = function(status) { - var message = GuacUI.Client.errors[status.code] || GuacUI.Client.errors.DEFAULT; + var message = GuacUI.Client.tunnel_errors[status.code] || GuacUI.Client.tunnel_errors.DEFAULT; GuacUI.Client.showError("Connection Error", message); }; diff --git a/guacamole/src/main/webapp/scripts/client-ui.js b/guacamole/src/main/webapp/scripts/client-ui.js index 45a9f1f14..145789d37 100644 --- a/guacamole/src/main/webapp/scripts/client-ui.js +++ b/guacamole/src/main/webapp/scripts/client-ui.js @@ -64,9 +64,10 @@ GuacUI.Client = { }, /** - * Enumeration of all error messages for each applicable error code. + * Enumeration of all tunnel-specific error messages for each applicable + * error code. */ - "errors": { + "tunnel_errors": { 0x0201: "The Guacamole server has rejected this connection attempt \ because there are too many active connections. Please wait \ @@ -112,6 +113,51 @@ GuacUI.Client = { }, + /** + * Enumeration of all client-specific error messages for each applicable + * error code. + */ + "client_errors": { + + 0x0201: "This connection has been closed because the server is busy. \ + Please wait a few minutes and try again.", + + 0x0202: "The Guacamole server has closed the connection because the \ + remote desktop is taking too long to respond. Please try \ + again or contact your system administrator.", + + 0x0203: "The remote desktop server encountered an error and has closed \ + the connection. Please try again or contact your system \ + administrator.", + + 0x0205: "This connection has been closed because it conflicts with \ + another connection. Please try again later.", + + 0x0301: "Log in failed. Please reconnect and try again.", + + 0x0303: "You do not have permission to access this connection. If you \ + require access, please ask your system administrator to add \ + you the list of allowed users, or check your system settings.", + + 0x0308: "The Guacamole server has closed the connection because there \ + has been no response from your browser for long enough that \ + it appeared to be disconnected. This is commonly caused by \ + network problems, such as spotty wireless signal, or simply \ + very slow network speeds. Please check your network and try \ + again.", + + 0x031D: "The Guacamole server is denying access to this connection \ + because you have exhausted the limit for simultaneous \ + connection use by an individual user. Please close one or \ + more connections and try again.", + + "DEFAULT": "An internal error has occurred within the Guacamole \ + server, and the connection has been terminated. If \ + the problem persists, please notify your system \ + administrator, or check your system logs." + + }, + /** * Enumeration of all error messages for each applicable error code. This * list is specific to file uploads. @@ -884,7 +930,7 @@ GuacUI.Client.attach = function(guac) { guac.disconnect(); // Display error message - var message = GuacUI.Client.errors[status.code] || GuacUI.Client.errors.DEFAULT; + var message = GuacUI.Client.client_errors[status.code] || GuacUI.Client.client_errors.DEFAULT; GuacUI.Client.showError("Connection Error", message); };