summaryrefslogtreecommitdiffstats
path: root/remoting
diff options
context:
space:
mode:
Diffstat (limited to 'remoting')
-rw-r--r--remoting/resources/remoting_strings.grd6
-rw-r--r--remoting/webapp/client_session.js2
-rw-r--r--remoting/webapp/error.js4
-rw-r--r--remoting/webapp/host_list.js41
-rw-r--r--remoting/webapp/session_connector.js2
5 files changed, 26 insertions, 29 deletions
diff --git a/remoting/resources/remoting_strings.grd b/remoting/resources/remoting_strings.grd
index 7bb12ed..04e6e73 100644
--- a/remoting/resources/remoting_strings.grd
+++ b/remoting/resources/remoting_strings.grd
@@ -330,11 +330,11 @@
<message desc="Error displayed if an invalid access code is entered." name="IDR_ERROR_INVALID_ACCESS_CODE">
The access code is invalid. Please try again.
</message>
- <message desc="Error displayed when the host is online, but we are unable to connect to it due to network configuration." name="IDR_ERROR_NETWORK_FAILURE">
+ <message desc="Error displayed when the host is online, but we are unable to connect to it due to network configuration." name="IDR_ERROR_P2P_FAILURE">
Unable to reach the host. This is probably due to the configuration of the network you are using.
</message>
- <message desc="Error displayed by the client if the server does not respond to a network request." name="IDR_ERROR_NO_RESPONSE">
- The server failed to respond to the network request.
+ <message desc="Error displayed when the host is online, but we are unable to connect to it due to network configuration." name="IDR_ERROR_NETWORK_FAILURE">
+ Could not connect to the network. Please check that your device is on-line.
</message>
<message desc="Error displayed when the service returns a 503 error. Such errors are usually temporary, and resolve themselves in about 30 seconds." name="IDR_ERROR_SERVICE_UNAVAILABLE">
The service is temporarily unavailable. Please try again later.
diff --git a/remoting/webapp/client_session.js b/remoting/webapp/client_session.js
index 35c4b03..89fcc82 100644
--- a/remoting/webapp/client_session.js
+++ b/remoting/webapp/client_session.js
@@ -423,7 +423,7 @@ remoting.ClientSession.prototype.getError = function() {
case remoting.ClientSession.ConnectionError.INCOMPATIBLE_PROTOCOL:
return remoting.Error.INCOMPATIBLE_PROTOCOL;
case remoting.ClientSession.ConnectionError.NETWORK_FAILURE:
- return remoting.Error.NETWORK_FAILURE;
+ return remoting.Error.P2P_FAILURE;
case remoting.ClientSession.ConnectionError.HOST_OVERLOAD:
return remoting.Error.HOST_OVERLOAD;
default:
diff --git a/remoting/webapp/error.js b/remoting/webapp/error.js
index ff8b529..a1e3ab3 100644
--- a/remoting/webapp/error.js
+++ b/remoting/webapp/error.js
@@ -11,7 +11,6 @@ var remoting = remoting || {};
* @enum {string} All error messages from messages.json
*/
remoting.Error = {
- NO_RESPONSE: /*i18n-content*/'ERROR_NO_RESPONSE',
INVALID_ACCESS_CODE: /*i18n-content*/'ERROR_INVALID_ACCESS_CODE',
MISSING_PLUGIN: /*i18n-content*/'ERROR_MISSING_PLUGIN',
AUTHENTICATION_FAILED: /*i18n-content*/'ERROR_AUTHENTICATION_FAILED',
@@ -23,5 +22,6 @@ remoting.Error = {
UNEXPECTED: /*i18n-content*/'ERROR_UNEXPECTED',
SERVICE_UNAVAILABLE: /*i18n-content*/'ERROR_SERVICE_UNAVAILABLE',
NOT_AUTHENTICATED: /*i18n-content*/'ERROR_NOT_AUTHENTICATED',
- INVALID_HOST_DOMAIN: /*i18n-content*/'ERROR_INVALID_HOST_DOMAIN'
+ INVALID_HOST_DOMAIN: /*i18n-content*/'ERROR_INVALID_HOST_DOMAIN',
+ P2P_FAILURE: /*i18n-content*/'ERROR_P2P_FAILURE'
};
diff --git a/remoting/webapp/host_list.js b/remoting/webapp/host_list.js
index 4bfdb4e..f5daa24 100644
--- a/remoting/webapp/host_list.js
+++ b/remoting/webapp/host_list.js
@@ -143,7 +143,6 @@ remoting.HostList.prototype.refresh = function(onDone) {
};
/** @param {remoting.Error} error */
var onError = function(error) {
- that.hosts_ = [];
that.lastError_ = error;
onDone(false);
};
@@ -161,7 +160,6 @@ remoting.HostList.prototype.refresh = function(onDone) {
* @private
*/
remoting.HostList.prototype.parseHostListResponse_ = function(onDone, xhr) {
- this.hosts_ = [];
this.lastError_ = '';
try {
if (xhr.status == 200) {
@@ -192,7 +190,7 @@ remoting.HostList.prototype.parseHostListResponse_ = function(onDone, xhr) {
// Some other error.
console.error('Bad status on host list query: ', xhr);
if (xhr.status == 0) {
- this.lastError_ = remoting.Error.NO_RESPONSE;
+ this.lastError_ = remoting.Error.NETWORK_FAILURE;
} else if (xhr.status == 401) {
this.lastError_ = remoting.Error.AUTHENTICATION_FAILED;
} else if (xhr.status == 502 || xhr.status == 503) {
@@ -224,23 +222,6 @@ remoting.HostList.prototype.display = function() {
this.table_.hidden = noHostsRegistered;
this.noHosts_.hidden = !noHostsRegistered;
- for (var i = 0; i < this.hosts_.length; ++i) {
- /** @type {remoting.Host} */
- var host = this.hosts_[i];
- // Validate the entry to make sure it has all the fields we expect and is
- // not the local host (which is displayed separately). NB: if the host has
- // never sent a heartbeat, then there will be no jabberId.
- if (host.hostName && host.hostId && host.status && host.publicKey &&
- (!this.localHost_ || host.hostId != this.localHost_.hostId)) {
- var hostTableEntry = new remoting.HostTableEntry(
- host, this.webappMajorVersion_,
- this.renameHost_.bind(this), this.deleteHost_.bind(this));
- hostTableEntry.createDom();
- this.hostTableEntries_[i] = hostTableEntry;
- this.table_.appendChild(hostTableEntry.tableRow);
- }
- }
-
if (this.lastError_ != '') {
l10n.localizeElementFromTag(this.errorMsg_, this.lastError_);
if (this.lastError_ == remoting.Error.AUTHENTICATION_FAILED) {
@@ -250,7 +231,25 @@ remoting.HostList.prototype.display = function() {
l10n.localizeElementFromTag(this.errorButton_,
/*i18n-content*/'RETRY');
}
+ } else {
+ for (var i = 0; i < this.hosts_.length; ++i) {
+ /** @type {remoting.Host} */
+ var host = this.hosts_[i];
+ // Validate the entry to make sure it has all the fields we expect and is
+ // not the local host (which is displayed separately). NB: if the host has
+ // never sent a heartbeat, then there will be no jabberId.
+ if (host.hostName && host.hostId && host.status && host.publicKey &&
+ (!this.localHost_ || host.hostId != this.localHost_.hostId)) {
+ var hostTableEntry = new remoting.HostTableEntry(
+ host, this.webappMajorVersion_,
+ this.renameHost_.bind(this), this.deleteHost_.bind(this));
+ hostTableEntry.createDom();
+ this.hostTableEntries_[i] = hostTableEntry;
+ this.table_.appendChild(hostTableEntry.tableRow);
+ }
+ }
}
+
this.errorMsg_.parentNode.hidden = (this.lastError_ == '');
var state = this.localHostState_;
@@ -441,8 +440,6 @@ remoting.HostList.prototype.onErrorClick_ = function() {
if (this.lastError_ == remoting.Error.AUTHENTICATION_FAILED) {
remoting.oauth2.doAuthRedirect();
} else {
- this.lastError_ = '';
- this.display();
this.refresh(remoting.updateLocalHostState);
}
};
diff --git a/remoting/webapp/session_connector.js b/remoting/webapp/session_connector.js
index 7816144..015e43e 100644
--- a/remoting/webapp/session_connector.js
+++ b/remoting/webapp/session_connector.js
@@ -392,7 +392,7 @@ remoting.SessionConnector.prototype.startAccessTokenRefreshTimer_ = function() {
remoting.SessionConnector.prototype.translateSupportHostsError =
function(error) {
switch (error) {
- case 0: return remoting.Error.NO_RESPONSE;
+ case 0: return remoting.Error.NETWORK_FAILURE;
case 404: return remoting.Error.INVALID_ACCESS_CODE;
case 502: // No break
case 503: return remoting.Error.SERVICE_UNAVAILABLE;