Moved stringifyError into its own file as it was causing strict compile issues in ErrorHandlingUtils

This commit is contained in:
Chuck Skelton
2026-05-27 18:24:46 -07:00
parent ed7ae08c5b
commit e842196df9
10 changed files with 18 additions and 16 deletions
+1 -8
View File
@@ -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,