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

Unified Diff: remoting/webapp/app_remoting/js/app_remoting.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/remoting_webapp_files.gypi ('k') | remoting/webapp/base/js/application.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/webapp/app_remoting/js/app_remoting.js
diff --git a/remoting/webapp/app_remoting/js/app_remoting.js b/remoting/webapp/app_remoting/js/app_remoting.js
index 3d3b58566dc50bdee4b5e19897d15abb322564af..b821be60bea94755137d1875606f9a3857fd71c0 100644
--- a/remoting/webapp/app_remoting/js/app_remoting.js
+++ b/remoting/webapp/app_remoting/js/app_remoting.js
@@ -148,7 +148,8 @@ remoting.AppRemoting.prototype.start = function(connector, token) {
connector.connectMe2App(host, fetchThirdPartyToken);
} else if (response && response.status == 'pending') {
- that.handleError(remoting.Error.SERVICE_UNAVAILABLE);
+ that.handleError(new remoting.Error(
+ remoting.Error.Tag.SERVICE_UNAVAILABLE));
}
} else {
console.error('Invalid "runApplication" response from server.');
@@ -156,15 +157,19 @@ remoting.AppRemoting.prototype.start = function(connector, token) {
// been updated to properly report 'unknown' errors (rather than
// reporting them as AUTHENTICATION_FAILED).
if (xhr.status == 0) {
- that.handleError(remoting.Error.NETWORK_FAILURE);
+ that.handleError(new remoting.Error(
+ remoting.Error.Tag.NETWORK_FAILURE));
} else if (xhr.status == 401) {
- that.handleError(remoting.Error.AUTHENTICATION_FAILED);
+ that.handleError(new remoting.Error(
+ remoting.Error.Tag.AUTHENTICATION_FAILED));
} else if (xhr.status == 403) {
- that.handleError(remoting.Error.APP_NOT_AUTHORIZED);
+ that.handleError(new remoting.Error(
+ remoting.Error.Tag.APP_NOT_AUTHORIZED));
} else if (xhr.status == 502 || xhr.status == 503) {
- that.handleError(remoting.Error.SERVICE_UNAVAILABLE);
+ that.handleError(new remoting.Error(
+ remoting.Error.Tag.SERVICE_UNAVAILABLE));
} else {
- that.handleError(remoting.Error.UNEXPECTED);
+ that.handleError(remoting.Error.unexpected());
}
}
};
« no previous file with comments | « remoting/remoting_webapp_files.gypi ('k') | remoting/webapp/base/js/application.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698