UNPKG

1.67 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 headers?: Headers;
39 /**
40 * @public
41 * A member holding original error response by the graph service
42 */
43 body: any;
44 /**
45 * @public
46 * @constructor
47 * Creates an instance of GraphError
48 * @param {number} [statusCode = -1] - The status code of the error
49 * @param {string} [message] - The message of the error
50 * @param {Error} [baseError] - The base error
51 * @returns An instance of GraphError
52 */
53 constructor(statusCode?: number, message?: string, baseError?: Error);
54}