#38609 Show cancelled message on cancel

This commit is contained in:
Sandeep Somavarapu
2017-12-06 09:38:41 +01:00
parent ace285a4a3
commit 6a95d97a55

View File

@@ -37,6 +37,7 @@ import { IStateService } from 'vs/platform/state/common/state';
import { StateService } from 'vs/platform/state/node/stateService';
import { createLogService } from 'vs/platform/log/node/spdlogService';
import { registerGlobalLogService, ILogService } from 'vs/platform/log/common/log';
import { isPromiseCanceledError } from 'vs/base/common/errors';
const notFound = (id: string) => localize('notFound', "Extension '{0}' not found.", id);
const notInstalled = (id: string) => localize('notInstalled', "Extension '{0}' is not installed.", id);
@@ -97,6 +98,13 @@ class Main {
return this.extensionManagementService.install(extension).then(() => {
console.log(localize('successVsixInstall', "Extension '{0}' was successfully installed!", getBaseLabel(extension)));
}, error => {
if (isPromiseCanceledError(error)) {
console.log(localize('cancelVsixInstall', "Cancelled installing Extension '{0}'.", getBaseLabel(extension)));
return null;
} else {
return TPromise.wrapError(error);
}
});
});
@@ -135,7 +143,16 @@ class Main {
console.log(localize('installing', "Installing..."));
return this.extensionManagementService.installFromGallery(extension)
.then(() => console.log(localize('successInstall', "Extension '{0}' v{1} was successfully installed!", id, extension.version)));
.then(
() => console.log(localize('successInstall', "Extension '{0}' v{1} was successfully installed!", id, extension.version)),
error => {
if (isPromiseCanceledError(error)) {
console.log(localize('cancelVsixInstall', "Cancelled installing Extension '{0}'.", id));
return null;
} else {
return TPromise.wrapError(error);
}
});
});
});
});