mirror of
https://github.com/Azure/cosmos-explorer.git
synced 2026-06-08 13:37:29 +01:00
Users/chskelt/debug logging2 (#2503)
* Adding further console logging but also fixed lines with JSON.stringify(error) * Added retry mechanism for GETs for armRequest workflow * Moved stringifyError into its own file as it was causing strict compile issues in ErrorHandlingUtils
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import * as msal from "@azure/msal-browser";
|
||||
import { useBoolean } from "@fluentui/react-hooks";
|
||||
import { stringifyError } from "Common/stringifyError";
|
||||
import * as React from "react";
|
||||
import { ConfigContext } from "../ConfigContext";
|
||||
import {
|
||||
@@ -77,7 +78,7 @@ export function useAADAuth(config?: ConfigContext): ReturnType {
|
||||
localStorage.setItem("cachedTenantId", response.tenantId);
|
||||
} catch (error) {
|
||||
setAuthFailure({
|
||||
failureMessage: `Login failed: ${JSON.stringify(error)}`,
|
||||
failureMessage: `Login failed: ${stringifyError(error)}`,
|
||||
});
|
||||
}
|
||||
}, [msalInstance, config]);
|
||||
@@ -111,7 +112,7 @@ export function useAADAuth(config?: ConfigContext): ReturnType {
|
||||
localStorage.setItem("cachedTenantId", response.tenantId);
|
||||
} catch (error) {
|
||||
setAuthFailure({
|
||||
failureMessage: `Tenant switch failed: ${JSON.stringify(error)}`,
|
||||
failureMessage: `Tenant switch failed: ${stringifyError(error)}`,
|
||||
});
|
||||
}
|
||||
},
|
||||
@@ -144,7 +145,7 @@ export function useAADAuth(config?: ConfigContext): ReturnType {
|
||||
failureLinkAction: acquireTokens,
|
||||
});
|
||||
} else {
|
||||
const errorJson = JSON.stringify(error);
|
||||
const errorJson = stringifyError(error);
|
||||
setAuthFailure({
|
||||
failureMessage: `We were unable to establish authorization for this account, due to the following error: \n${errorJson}`,
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user