mirror of
https://github.com/Azure/cosmos-explorer.git
synced 2026-06-11 23:17:38 +01:00
Moved stringifyError into its own file as it was causing strict compile issues in ErrorHandlingUtils
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
import { stringifyError } from "Common/stringifyError";
|
||||
import { MessageTypes } from "../Contracts/ExplorerContracts";
|
||||
import { SubscriptionType } from "../Contracts/SubscriptionType";
|
||||
import { isExpectedError } from "../Metrics/ErrorClassification";
|
||||
@@ -14,14 +15,6 @@ export interface HandleErrorOptions {
|
||||
redactedError?: string | ARMError | Error;
|
||||
}
|
||||
|
||||
export const stringifyError = (error: unknown): string => {
|
||||
const plainObject: Record<string, unknown> = {};
|
||||
Object.getOwnPropertyNames(error as object).forEach((key) => {
|
||||
plainObject[key] = (error as Record<string, unknown>)[key];
|
||||
});
|
||||
return JSON.stringify(plainObject, null, "\r\n");
|
||||
};
|
||||
|
||||
export const handleError = (
|
||||
error: string | ARMError | Error,
|
||||
area: string,
|
||||
|
||||
Reference in New Issue
Block a user