microsoft/vscode-react-native

Public

mirrored from https://github.com/microsoft/vscode-react-nativeAvailable

CodeCommitsIssuesPull requestsActionsInsightsSecurity
c9e236d5d2eec69ff626c3a08f201ca3dfa1809b

Branches

Tags

  • No tags available.
0Branches0Tags
Go to file
Add file
Code

Clone

HTTPS

Download ZIP

src/common/nestedError.ts

20lines · modeblame

77e8babbdigeff10 years ago1// Copyright (c) Microsoft Corporation. All rights reserved.
2// Licensed under the MIT license. See LICENSE file in the project root for details.
3
10873e11digeff10 years ago4export class NestedError extends Error {
c5d308e4digeff10 years ago5private _innerError: Error | any; // Normally this should be an error, but we support any value
6private _extras: any;
10873e11digeff10 years ago7
cb6d0922digeff10 years ago8constructor(message: string, innerError: any, extras?: any) {
10873e11digeff10 years ago9super(message);
c5d308e4digeff10 years ago10this._innerError = innerError;
10873e11digeff10 years ago11this.name = innerError.name;
12const innerMessage = innerError.message;
13this.message = innerMessage ? `${message}: ${innerMessage}` : message;
c5d308e4digeff10 years ago14this._extras = extras;
15}
16
17public get extras(): any {
d66532e7digeff10 years ago18return this._extras;
10873e11digeff10 years ago19}
20}