microsoft/vscode-react-native

Public

mirrored fromhttps://github.com/microsoft/vscode-react-nativeAvailable

CodeCommitsIssuesPull requestsActionsInsightsSecurity
efbe1ba61ca71887b3fa9a2d1ae3afb9a78cb87e

Branches

Tags

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

Clone

HTTPS

Download ZIP

src/common/nestedError.ts

20lines · modecode

1// Copyright (c) Microsoft Corporation. All rights reserved.
2// Licensed under the MIT license. See LICENSE file in the project root for details.
3
4export class NestedError extends Error {
5 private _innerError: Error | any; // Normally this should be an error, but we support any value
6 private _extras: any;
7
8 constructor(message: string, innerError: any, extras?: any) {
9 super(message);
10 this._innerError = innerError;
11 this.name = innerError.name;
12 const innerMessage = this._innerError.message;
13 this.message = innerMessage ? `${message}: ${innerMessage}` : message;
14 this._extras = extras;
15 }
16
17 public get extras(): any {
18 return this._extras;
19 }
20}