Skip to content

Commit 68c0c00

Browse files
try catch to help with rebase:
1 parent 8cfc94c commit 68c0c00

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/mongo_logger.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -420,7 +420,11 @@ export function stringifyWithMaxLen(
420420
} else if (typeof value === 'function') {
421421
strToTruncate = value.toString();
422422
} else {
423-
strToTruncate = EJSON.stringify(value, options);
423+
try {
424+
strToTruncate = EJSON.stringify(value, options);
425+
} catch (e) {
426+
strToTruncate = `Extended JSON serialization failed with: ${e.message}`;
427+
}
424428
}
425429

426430
// handle truncation that occurs in the middle of multi-byte codepoints

0 commit comments

Comments
 (0)