UNPKG

1.63 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 GraphClientError
9 */
10/**
11 * @class
12 * Create GraphClientError object to handle client-side errors
13 * encountered within the JavaScript Client SDK.
14 * Whereas GraphError Class should be used to handle errors in the response from the Graph API.
15 */
16export declare class GraphClientError extends Error {
17 /**
18 * @public
19 * A custom error. This property should set be when the error is not of instanceOf Error/GraphClientError.
20 * Example =
21 * const client = MicrosoftGraph.Client.init({
22 * defaultVersion: "v1.0",
23 * authProvider: (done) => { done({TokenError:"AccessToken cannot be null"}, "<ACCESS_TOKEN>");
24 * });
25 */
26 customError?: any;
27 /**
28 * @public
29 * @static
30 * @async
31 * To set the GraphClientError object
32 * @param {any} error - The error returned encountered by the Graph JavaScript Client SDK while processing request
33 * @returns GraphClientError object set to the error passed
34 */
35 static setGraphClientError(error: any): GraphClientError;
36 /**
37 * @public
38 * @constructor
39 * Creates an instance of GraphClientError
40 * @param {string} message? - Error message
41 * @returns An instance of GraphClientError
42 */
43 constructor(message?: string);
44}