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

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: Simpler implementation. 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
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 3685946ef08a53ce7e2dbca4c2477df1278ae859..9c12281a47b4c2712f0bc90fc05b05805f322cb4 100644
--- a/remoting/webapp/app_remoting/js/app_remoting_activity.js
+++ b/remoting/webapp/app_remoting/js/app_remoting_activity.js
@@ -138,7 +138,13 @@ remoting.AppRemotingActivity.prototype.onAppHostResponse_ =
}
} else {
console.error('Invalid "runApplication" response from server.');
- this.onError(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.onError(error);
kelvinp 2015/04/24 22:14:37 need to merge with ToT to call onConnectionFailed(
}
};
@@ -179,7 +185,7 @@ remoting.AppRemotingActivity.prototype.onError = function(error) {
console.error('Connection failed: ' + error.toString());
remoting.LoadingWindow.close();
remoting.MessageWindow.showErrorMessage(
- chrome.i18n.getMessage(/*i18n-content*/'CONNECTION_FAILED'),
+ remoting.app.getApplicationName(),
Jamie 2015/04/24 22:04:52 See point (b), above.
chrome.i18n.getMessage(error.getTag()));
this.cleanup_();
};

Powered by Google App Engine
This is Rietveld 408576698