本文整理汇总了TypeScript中vs/base/common/errorMessage.toErrorMessage函数的典型用法代码示例。如果您正苦于以下问题:TypeScript toErrorMessage函数的具体用法?TypeScript toErrorMessage怎么用?TypeScript toErrorMessage使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了toErrorMessage函数的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的TypeScript代码示例。
示例1: toErrorMessage
this.call(traverse, this, folderQuery, onResult, onMessage, (err?: Error) => {
if (err) {
const errorMessage = toErrorMessage(err);
console.error(errorMessage);
this.errors.push(errorMessage);
rootFolderDone(err, undefined);
} else {
rootFolderDone(undefined, undefined);
}
});
开发者ID:JarnoNijboer,项目名称:vscode,代码行数:10,代码来源:fileSearch.ts
示例2: onDidNotificationChange
private onDidNotificationChange(e: INotificationChangeEvent): void {
if (e.kind === NotificationChangeType.ADD) {
// ARIA alert for screen readers
this.ariaAlert(e.item);
// Always log errors to console with full details
if (e.item.severity === Severity.Error) {
console.error(toErrorMessage(e.item.message.value, true));
}
}
}
开发者ID:AllureFer,项目名称:vscode,代码行数:12,代码来源:notificationsAlerts.ts
示例3: rootFolderDone
this.call(traverse, this, folderQuery, onResult, (err?: Error) => {
if (err) {
if (isNodeTraversal) {
rootFolderDone(err, undefined);
} else {
// fallback
const errorMessage = toErrorMessage(err);
console.error(errorMessage);
this.errors.push(errorMessage);
this.nodeJSTraversal(folderQuery, onResult, err => rootFolderDone(err, undefined));
}
} else {
rootFolderDone(undefined, undefined);
}
});
开发者ID:naturtle,项目名称:vscode,代码行数:15,代码来源:fileSearch.ts
示例4: rootFolderDone
this.call(traverse, this, rootFolder, onResult, (err?: Error) => {
if (err) {
if (isNodeTraversal) {
rootFolderDone(err);
} else {
// fallback
const errorMessage = toErrorMessage(err);
console.error(errorMessage);
this.errors.push(errorMessage);
this.nodeJSTraversal(rootFolder, onResult, rootFolderDone);
}
} else {
rootFolderDone();
}
});
开发者ID:FabianLauer,项目名称:vscode,代码行数:15,代码来源:fileSearch.ts
示例5: test
test('Get Error Message', function () {
assert.strictEqual(toErrorMessage('Foo Bar'), 'Foo Bar');
assert.strictEqual(toErrorMessage(new Error('Foo Bar')), 'Foo Bar');
var error: any = new Error();
error.status = 404;
error.statusText = 'Not Found';
assert.strictEqual(toErrorMessage(error), 'Not Found (HTTP 404)');
error = new Error();
error.detail = {};
error.detail.exception = {};
error.detail.exception.message = 'Foo Bar';
assert.strictEqual(toErrorMessage(error), 'Foo Bar');
error = new Error();
error.detail = {};
error.detail.error = {};
error.detail.error.status = 404;
error.detail.error.statusText = 'Not Found';
assert.strictEqual(toErrorMessage(error), 'Not Found (HTTP 404)');
error = new Error();
error.detail = {};
error.detail.error = [];
var foo: any = {};
error.detail.error.push(foo);
foo.status = 404;
foo.statusText = 'Not Found';
assert.strictEqual(toErrorMessage(error), 'Not Found (HTTP 404)');
assert(toErrorMessage());
assert(toErrorMessage(null));
assert(toErrorMessage({}));
});
开发者ID:GYGit,项目名称:vscode,代码行数:36,代码来源:errors.test.ts
示例6: doShow
private doShow(sev: Severity, message: any): () => void {
// Check flag if we can show a message now
if (!this.canShowMessages) {
const messageObj: IBufferedMessage = { severity: sev, message, disposeFn: () => this.messageBuffer.splice(this.messageBuffer.indexOf(messageObj), 1) };
this.messageBuffer.push(messageObj);
// Return function that allows to remove message from buffer
return () => messageObj.disposeFn();
}
// Show in Console
if (sev === Severity.Error) {
console.error(toErrorMessage(message, true));
}
// Show in Global Handler
return this.handler.showMessage(this.toBaseSeverity(sev), message);
}
开发者ID:GYGit,项目名称:vscode,代码行数:19,代码来源:messageService.ts
示例7: test
test('Get Error Message', function () {
assert.strictEqual(toErrorMessage('Foo Bar'), 'Foo Bar');
assert.strictEqual(toErrorMessage(new Error('Foo Bar')), 'Foo Bar');
let error: any = new Error();
error = new Error();
error.detail = {};
error.detail.exception = {};
error.detail.exception.message = 'Foo Bar';
assert.strictEqual(toErrorMessage(error), 'Foo Bar');
assert(toErrorMessage());
assert(toErrorMessage(null));
assert(toErrorMessage({}));
});
开发者ID:DonJayamanne,项目名称:vscode,代码行数:15,代码来源:errors.test.ts
示例8: toErrorMessage
return textFileService.revertAll(resources, { force: true }).then(null, error => {
notificationService.error(nls.localize('genericRevertError', "Failed to revert '{0}': {1}", resources.map(r => paths.basename(r.fsPath)).join(', '), toErrorMessage(error, false)));
});
开发者ID:jinlongchen2018,项目名称:vscode,代码行数:3,代码来源:fileCommands.ts
示例9: basename
return textFileService.revertAll(resources, { force: true }).then(null, error => {
messageService.show(Severity.Error, nls.localize('genericRevertError', "Failed to revert '{0}': {1}", basename(resource.fsPath), toErrorMessage(error, false)));
});
开发者ID:tonycleveland,项目名称:vscode,代码行数:3,代码来源:fileCommands.ts
注:本文中的vs/base/common/errorMessage.toErrorMessage函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论