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

Unified Diff: remoting/webapp/base/js/application.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/app_remoting/js/app_remoting.js ('k') | remoting/webapp/browser_test/mock_host_list_api.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/webapp/base/js/application.js
diff --git a/remoting/webapp/base/js/application.js b/remoting/webapp/base/js/application.js
index f33f2eeb71cfbe09156d36438ae21108def7a658..40ee35fdb03490457e7cd8983ee1332972778b70 100644
--- a/remoting/webapp/base/js/application.js
+++ b/remoting/webapp/base/js/application.js
@@ -94,7 +94,7 @@ remoting.Application.prototype.start = function() {
this.delegate_.start.bind(this.delegate_, this.getSessionConnector())
).catch(remoting.Error.handler(
function(/** !remoting.Error */ error) {
- if (error == remoting.Error.CANCELLED) {
+ if (error.hasTag(remoting.Error.Tag.CANCELLED)) {
that.exit();
} else {
that.delegate_.signInFailed(error);
@@ -115,7 +115,7 @@ remoting.Application.prototype.exit = function() {
/** Disconnect the remoting client. */
remoting.Application.prototype.disconnect = function() {
if (remoting.clientSession) {
- remoting.clientSession.disconnect(remoting.Error.NONE);
+ remoting.clientSession.disconnect(remoting.Error.none());
console.log('Disconnected.');
}
};
@@ -236,7 +236,7 @@ remoting.Application.prototype.onClientStateChange_ = function(state) {
var error = remoting.clientSession.getError();
console.error('Client plugin reported connection failed: ' + error);
if (error === null) {
- error = remoting.Error.UNEXPECTED;
+ error = remoting.Error.unexpected();
}
this.onError(error);
break;
@@ -245,7 +245,7 @@ remoting.Application.prototype.onClientStateChange_ = function(state) {
console.error('Unexpected client plugin state: ' + state.current);
// This should only happen if the web-app and client plugin get out of
// sync, so MISSING_PLUGIN is a suitable error.
- this.onError(remoting.Error.MISSING_PLUGIN);
+ this.onError(new remoting.Error(remoting.Error.Tag.MISSING_PLUGIN));
break;
}
« no previous file with comments | « remoting/webapp/app_remoting/js/app_remoting.js ('k') | remoting/webapp/browser_test/mock_host_list_api.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698