mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-24 01:25:37 -05:00
29 lines
1011 B
TypeScript
29 lines
1011 B
TypeScript
/*---------------------------------------------------------------------------------------------
|
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
|
*--------------------------------------------------------------------------------------------*/
|
|
'use strict';
|
|
|
|
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 {
|
|
|
|
dispose(): void {
|
|
//
|
|
}
|
|
|
|
$onUnexpectedError(err: any | SerializedError): void {
|
|
if (err && err.$isError) {
|
|
const { name, message, stack } = err;
|
|
err = new Error();
|
|
err.message = message;
|
|
err.name = name;
|
|
err.stack = stack;
|
|
}
|
|
onUnexpectedError(err);
|
|
}
|
|
}
|