aethex-forge/client/lib/error-utils.ts
Builder.io 5149ef184d Add projects table migration with RLS and policies
cgen-1889eb269a534dca875135ae45774c03
2025-10-18 04:11:47 +00:00

11 lines
348 B
TypeScript

export function normalizeErrorMessage(err: any): string {
if (!err) return "Unknown error";
if (typeof err === "string") return err;
const m = err?.message || err?.error_description || err?.error || err?.msg;
if (typeof m === "string" && m.trim()) return m;
try {
return JSON.stringify(err);
} catch {
return String(err);
}
}