Skip to content

Commit 8632fb6

Browse files
committed
return object from normalize in case of error, including error message
1 parent f36827c commit 8632fb6

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

packages/utils/src/normalize.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ export function normalize(input: unknown, depth: number = +Infinity, maxProperti
3131
try {
3232
// since we're at the outermost level, there is no key
3333
return visit('', input as UnknownMaybeWithToJson, depth, maxProperties);
34-
} catch (_oO) {
35-
return '**non-serializable**';
34+
} catch (err) {
35+
return { ERROR: `**non-serializable** (${err})` };
3636
}
3737
}
3838

0 commit comments

Comments
 (0)