refactor(logging): replace console usage in auth flows

This commit is contained in:
William Valentin
2025-09-23 10:15:57 -07:00
parent 6b6a44acef
commit c1c8e28f01
4 changed files with 104 additions and 32 deletions

15
utils/error.ts Normal file
View File

@@ -0,0 +1,15 @@
export const normalizeError = (error: unknown): Error => {
if (error instanceof Error) {
return error;
}
if (typeof error === 'string') {
return new Error(error);
}
try {
return new Error(JSON.stringify(error));
} catch {
return new Error('Unknown error');
}
};