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 · modepreview

// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for details.

export class NestedError extends Error {
    private _innerError: Error | any; // Normally this should be an error, but we support any value
    private _extras: any;

    constructor(message: string, innerError: any, extras?: any) {
        super(message);
        this._innerError = innerError;
        this.name = innerError.name;
        const innerMessage = this._innerError.message;
        this.message = innerMessage ? `${message}: ${innerMessage}` : message;
        this._extras = extras;
    }

    public get extras(): any {
        return this._extras;
    }
}