UNPKG

1.58 kBTypeScriptView Raw
1/**
2 * -------------------------------------------------------------------------------------------
3 * Copyright (c) Microsoft Corporation. All Rights Reserved. Licensed under the MIT License.
4 * See License in the project root for license information.
5 * -------------------------------------------------------------------------------------------
6 */
7/**
8 * @module GraphError
9 */
10/**
11 * @class
12 * Class for GraphError
13 * @NOTE: This is NOT what is returned from the Graph
14 * GraphError is created from parsing JSON errors returned from the graph
15 * Some fields are renamed ie, "request-id" => requestId so you can use dot notation
16 */
17export declare class GraphError extends Error {
18 /**
19 * @public
20 * A member holding status code of the error
21 */
22 statusCode: number;
23 /**
24 * @public
25 * A member holding code i.e name of the error
26 */
27 code: string | null;
28 /**
29 * @public
30 * A member holding request-id i.e identifier of the request
31 */
32 requestId: string | null;
33 /**
34 * @public
35 * A member holding processed date and time of the request
36 */
37 date: Date;
38 /**
39 * @public
40 * A member holding original error response by the graph service
41 */
42 body: any;
43 /**
44 * @public
45 * @constructor
46 * Creates an instance of GraphError
47 * @param {number} [statusCode = -1] - The status code of the error
48 * @returns An instance of GraphError
49 */
50 constructor(statusCode?: number, message?: string, baseError?: Error);
51}