Commit df3da736 authored by jamiewalch's avatar jamiewalch Committed by Commit bot

Fix not-authorized error message.

BUG=b/19899195

Review URL: https://codereview.chromium.org/1073003005

Cr-Commit-Position: refs/heads/master@{#326935}
parent ad0371ec
...@@ -48,7 +48,7 @@ remoting.AppRemoting.prototype.getActivity = function() { ...@@ -48,7 +48,7 @@ remoting.AppRemoting.prototype.getActivity = function() {
*/ */
remoting.AppRemoting.prototype.signInFailed_ = function(error) { remoting.AppRemoting.prototype.signInFailed_ = function(error) {
remoting.MessageWindow.showErrorMessage( remoting.MessageWindow.showErrorMessage(
chrome.i18n.getMessage(/*i18n-content*/'CONNECTION_FAILED'), this.getApplicationName(),
chrome.i18n.getMessage(error.getTag())); chrome.i18n.getMessage(error.getTag()));
}; };
......
...@@ -145,7 +145,13 @@ remoting.AppRemotingActivity.prototype.onAppHostResponse_ = ...@@ -145,7 +145,13 @@ remoting.AppRemotingActivity.prototype.onAppHostResponse_ =
} }
} else { } else {
console.error('Invalid "runApplication" response from server.'); 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) { ...@@ -194,7 +200,7 @@ remoting.AppRemotingActivity.prototype.onConnectionFailed = function(error) {
remoting.AppRemotingActivity.prototype.showErrorMessage_ = function(error) { remoting.AppRemotingActivity.prototype.showErrorMessage_ = function(error) {
console.error('Connection failed: ' + error.toString()); console.error('Connection failed: ' + error.toString());
remoting.MessageWindow.showErrorMessage( remoting.MessageWindow.showErrorMessage(
chrome.i18n.getMessage(/*i18n-content*/'CONNECTION_FAILED'), remoting.app.getApplicationName(),
chrome.i18n.getMessage(error.getTag())); chrome.i18n.getMessage(error.getTag()));
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment