From 4a247f0a73cdc6e76e9f18d144cc96c2b8ad84d3 Mon Sep 17 00:00:00 2001 From: Ben White Date: Wed, 1 Apr 2026 12:00:00 +0800 Subject: [PATCH] fix: Rrror parser throw (#1225) * Warn instead of throwing error when parsing for console logs * Added error to warning --- .../rrweb/src/plugins/console/record/error-stack-parser.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/rrweb/src/plugins/console/record/error-stack-parser.ts b/packages/rrweb/src/plugins/console/record/error-stack-parser.ts index 4c0e49c3..b3448793 100644 --- a/packages/rrweb/src/plugins/console/record/error-stack-parser.ts +++ b/packages/rrweb/src/plugins/console/record/error-stack-parser.ts @@ -71,7 +71,11 @@ export const ErrorStackParser = { } else if (error.stack) { return this.parseFFOrSafari(error as { stack: string }); } else { - throw new Error('Cannot parse given Error object'); + console.warn( + '[console-record-plugin]: Failed to parse error object:', + error, + ); + return []; } }, // Separate line and column numbers from a string of the form: (URI:Line:Column)