Bug 1057155 - Stop error on remote runtime cancel. r=paul

This commit is contained in:
J. Ryan Stinnett 2014-08-22 11:52:06 -07:00
parent a51594a4be
commit e8934d56a0
3 changed files with 12 additions and 7 deletions

View File

@ -246,8 +246,11 @@ let UI = {
this.unbusy();
}, (e) => {
this.cancelBusyTimeout();
UI.reportError("error_operationFail", operationDescription);
console.error(e);
let operationCanceled = e && e.canceled;
if (!operationCanceled) {
UI.reportError("error_operationFail", operationDescription);
console.error(e);
}
this.unbusy();
});
return promise;

View File

@ -337,7 +337,7 @@ exports.AppManager = AppManager = {
try {
this.selectedRuntime.connect(this.connection).then(
() => {},
() => {deferred.reject()});
deferred.reject.bind(deferred));
} catch(e) {
console.error(e);
deferred.reject();

View File

@ -126,11 +126,13 @@ let gRemoteRuntime = {
return promise.reject();
}
let ret = {value: connection.host + ":" + connection.port};
Services.prompt.prompt(win,
Strings.GetStringFromName("remote_runtime_promptTitle"),
Strings.GetStringFromName("remote_runtime_promptMessage"),
ret, null, {});
let title = Strings.GetStringFromName("remote_runtime_promptTitle");
let message = Strings.GetStringFromName("remote_runtime_promptMessage");
let ok = Services.prompt.prompt(win, title, message, ret, null, {});
let [host,port] = ret.value.split(":");
if (!ok) {
return promise.reject({canceled: true});
}
if (!host || !port) {
return promise.reject();
}