Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(143)

Unified Diff: remoting/webapp/crd/js/session_connector_impl.js

Issue 1004513002: Eliminated named constants for instances of remoting.Error. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « remoting/webapp/crd/js/server_log_entry.js ('k') | remoting/webapp/crd/js/wcs_adapter.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/webapp/crd/js/session_connector_impl.js
diff --git a/remoting/webapp/crd/js/session_connector_impl.js b/remoting/webapp/crd/js/session_connector_impl.js
index b415a47f8ba0ac9a662d2a59623d1e30f29bbc40..b84feee9a8dddd85227d24242f1b31120a195569 100644
--- a/remoting/webapp/crd/js/session_connector_impl.js
+++ b/remoting/webapp/crd/js/session_connector_impl.js
@@ -344,13 +344,14 @@ remoting.SessionConnectorImpl.prototype.onPluginInitialized_ = function(
initialized) {
if (!initialized) {
console.error('ERROR: remoting plugin not loaded');
- this.pluginError_(remoting.Error.MISSING_PLUGIN);
+ this.pluginError_(new remoting.Error(remoting.Error.Tag.MISSING_PLUGIN));
return;
}
if (!this.plugin_.isSupportedVersion()) {
console.error('ERROR: bad plugin version');
- this.pluginError_(remoting.Error.BAD_PLUGIN_VERSION);
+ this.pluginError_(new remoting.Error(
+ remoting.Error.Tag.BAD_PLUGIN_VERSION));
return;
}
@@ -506,14 +507,15 @@ remoting.SessionConnectorImpl.prototype.onStateChange_ = function(event) {
// accepting it. Since there's no way of knowing exactly what went wrong,
// we rely on server-side logs in this case and report a generic error
// message.
- this.onError_(remoting.Error.UNEXPECTED);
+ this.onError_(remoting.Error.unexpected());
break;
case remoting.ClientSession.State.FAILED:
var error = this.clientSession_.getError();
- console.error('Client plugin reported connection failed: ' + error);
+ console.error('Client plugin reported connection failed: ' +
+ error.toString());
if (error == null) {
- error = remoting.Error.UNEXPECTED;
+ error = remoting.Error.unexpected();
}
this.onConnectionFailed_(error);
break;
@@ -522,7 +524,7 @@ remoting.SessionConnectorImpl.prototype.onStateChange_ = function(event) {
console.error('Unexpected client plugin state: ' + event.current);
// This should only happen if the web-app and client plugin get out of
// sync, and even then the version check should ensure compatibility.
- this.onError_(remoting.Error.MISSING_PLUGIN);
+ this.onError_(new remoting.Error(remoting.Error.Tag.MISSING_PLUGIN));
}
};
« no previous file with comments | « remoting/webapp/crd/js/server_log_entry.js ('k') | remoting/webapp/crd/js/wcs_adapter.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698