mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-25 11:08:51 +01:00
send extension id to main thread and decide there how to show errors, #32766
This commit is contained in:
@@ -4,24 +4,25 @@
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
'use strict';
|
||||
|
||||
import * as errors from 'vs/base/common/errors';
|
||||
import { SerializedError, onUnexpectedError } from 'vs/base/common/errors';
|
||||
import { MainThreadErrorsShape, MainContext } from '../node/extHost.protocol';
|
||||
import { extHostNamedCustomer } from "vs/workbench/api/electron-browser/extHostCustomers";
|
||||
|
||||
@extHostNamedCustomer(MainContext.MainThreadErrors)
|
||||
export class MainThreadErrors implements MainThreadErrorsShape {
|
||||
|
||||
public dispose(): void {
|
||||
dispose(): void {
|
||||
//
|
||||
}
|
||||
|
||||
public $onUnexpectedExtHostError(err: any | errors.SerializedError): void {
|
||||
$onUnexpectedError(err: any | SerializedError, extensionId: string | undefined): void {
|
||||
if (err.$isError) {
|
||||
const { name, message, stack } = err;
|
||||
err = new Error();
|
||||
err.message = extensionId ? `[${extensionId}] ${message}` : message;
|
||||
err.name = name;
|
||||
err.message = message;
|
||||
err.stack = stack;
|
||||
}
|
||||
errors.onUnexpectedError(err);
|
||||
onUnexpectedError(err);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user