Skip to content

Commit d39f0e4

Browse files
try catch to help with rebase:
1 parent 99dfafa commit d39f0e4

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
@@ -425,7 +425,11 @@ export function stringifyWithMaxLen(
425425
} else if (typeof value === 'function') {
426426
strToTruncate = value.toString();
427427
} else {
428-
strToTruncate = EJSON.stringify(value, options);
428+
try {
429+
strToTruncate = EJSON.stringify(value, options);
430+
} catch (e) {
431+
strToTruncate = `Extended JSON serialization failed with: ${e.message}`;
432+
}
429433
}
430434

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

0 commit comments

Comments
 (0)