提交 870c700e 编写于 作者: J Joao Moreno

parse gallery error message

fixes #6761
上级 91198c9b
......@@ -15,7 +15,7 @@ import { IEnvironmentService } from 'vs/platform/environment/common/environment'
import { EnvironmentService } from 'vs/platform/environment/node/environmentService';
import { IEventService } from 'vs/platform/event/common/event';
import { EventService } from 'vs/platform/event/common/eventService';
import { IExtensionManagementService, IExtensionGalleryService } from 'vs/platform/extensionManagement/common/extensionManagement';
import { IExtensionManagementService, IExtensionGalleryService, IQueryResult } from 'vs/platform/extensionManagement/common/extensionManagement';
import { getExtensionId } from 'vs/platform/extensionManagement/node/extensionManagementUtil';
import { ExtensionManagementService } from 'vs/platform/extensionManagement/node/extensionManagementService';
import { ExtensionGalleryService } from 'vs/platform/extensionManagement/node/extensionGalleryService';
......@@ -68,7 +68,18 @@ class Main {
return TPromise.wrapError(localize('alreadyInstalled', "Extension '{0}' is already installed.", id));
}
return this.extensionGalleryService.query({ ids: [id] }).then(result => {
return this.extensionGalleryService.query({ ids: [id] })
.then<IQueryResult>(null, err => {
if (err.responseText) {
try {
const response = JSON.parse(err.responseText);
return TPromise.wrapError(response.message);
} catch (e) {
return TPromise.wrapError(err);
}
}
})
.then(result => {
const [extension] = result.firstPage;
if (!extension) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册