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

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

Issue 955283002: Converted remoting.Error from an enum to a class (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/host_controller.js ('k') | remoting/webapp/crd/js/host_install_dialog.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/webapp/crd/js/host_daemon_facade.js
diff --git a/remoting/webapp/crd/js/host_daemon_facade.js b/remoting/webapp/crd/js/host_daemon_facade.js
index 43aec855d393d963f0100fd079057c2eb7c74274..979fdf147edec48b3728e9ec2f65bce607af5547 100644
--- a/remoting/webapp/crd/js/host_daemon_facade.js
+++ b/remoting/webapp/crd/js/host_daemon_facade.js
@@ -42,7 +42,7 @@ remoting.HostDaemonFacade = function() {
this.initializingPromise_ = null;
/** @private {!remoting.Error} */
- this.error_ = remoting.Error.NONE;
+ this.error_ = remoting.Error.none();
/** @private */
this.onIncomingMessageCallback_ = this.onIncomingMessage_.bind(this);
@@ -207,7 +207,7 @@ remoting.HostDaemonFacade.prototype.onIncomingMessage_ = function(message) {
this.handleIncomingMessage_(message, reply.onDone);
} catch (/** @type {*} */ e) {
console.error('Error while processing native message' + e);
- reply.onError(remoting.Error.UNEXPECTED);
+ reply.onError(remoting.Error.unexpected());
}
}
@@ -324,8 +324,9 @@ remoting.HostDaemonFacade.prototype.onDisconnect_ = function() {
// If initialization hasn't finished then assume that the port was
// disconnected because Native Messaging host is not installed.
- this.error_ = this.initializingPromise_ ? remoting.Error.MISSING_PLUGIN :
- remoting.Error.UNEXPECTED;
+ this.error_ = this.initializingPromise_ ?
+ new remoting.Error(remoting.Error.Tag.MISSING_PLUGIN) :
+ remoting.Error.unexpected();
// Notify the error-handlers of any requests that are still outstanding.
var pendingReplies = this.pendingReplies_;
« no previous file with comments | « remoting/webapp/crd/js/host_controller.js ('k') | remoting/webapp/crd/js/host_install_dialog.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698