fix: tame invalid config logging

This commit is contained in:
Peter Steinberger
2026-01-21 01:58:08 +00:00
parent 27acfa59c5
commit e81ca7ab00
7 changed files with 30 additions and 13 deletions

View File

@@ -20,3 +20,13 @@ export function formatErrorMessage(err: unknown): string {
return Object.prototype.toString.call(err);
}
}
export function formatUncaughtError(err: unknown): string {
if (extractErrorCode(err) === "INVALID_CONFIG") {
return formatErrorMessage(err);
}
if (err instanceof Error) {
return err.stack ?? err.message ?? err.name;
}
return formatErrorMessage(err);
}