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

Unified Diff: remoting/webapp/app_remoting/js/app_remoting_activity.js

Issue 1073003005: Fix not-authorized error message. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase. Created 5 years, 8 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') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/webapp/app_remoting/js/app_remoting_activity.js
diff --git a/remoting/webapp/app_remoting/js/app_remoting_activity.js b/remoting/webapp/app_remoting/js/app_remoting_activity.js
index 2e9ff73463c6515ea9a2d89871fbd874986deb7e..8afef921a5693532695ef3227d12b4cd467c8dba 100644
--- a/remoting/webapp/app_remoting/js/app_remoting_activity.js
+++ b/remoting/webapp/app_remoting/js/app_remoting_activity.js
@@ -145,7 +145,13 @@ remoting.AppRemotingActivity.prototype.onAppHostResponse_ =
}
} else {
console.error('Invalid "runApplication" response from server.');
- this.onConnectionFailed(remoting.Error.fromHttpStatus(xhrResponse.status));
+ // The orchestrator returns 403 if the user is not whitelisted to run the
+ // app, which gets translated to a generic error message, so pick something
+ // a bit more user-friendly.
+ var error = xhrResponse.status == 403 ?
+ new remoting.Error(remoting.Error.Tag.APP_NOT_AUTHORIZED) :
+ remoting.Error.fromHttpStatus(xhrResponse.status);
+ this.onConnectionFailed(error);
}
};
@@ -194,7 +200,7 @@ remoting.AppRemotingActivity.prototype.onConnectionFailed = function(error) {
remoting.AppRemotingActivity.prototype.showErrorMessage_ = function(error) {
console.error('Connection failed: ' + error.toString());
remoting.MessageWindow.showErrorMessage(
- chrome.i18n.getMessage(/*i18n-content*/'CONNECTION_FAILED'),
+ remoting.app.getApplicationName(),
chrome.i18n.getMessage(error.getTag()));
};
« no previous file with comments | « remoting/webapp/app_remoting/js/app_remoting.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698