We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
isTruncated
JSON.parse
1 parent 99c8fcd commit 6548ac9Copy full SHA for 6548ac9
packages/replay/src/coreHandlers/handleScope.ts
@@ -86,9 +86,11 @@ export function normalizeConsoleBreadcrumb(breadcrumb: Breadcrumb): Breadcrumb {
86
const normalizedArg = normalize(arg, 7);
87
const stringified = JSON.stringify(normalizedArg);
88
if (stringified.length > CONSOLE_ARG_MAX_SIZE) {
89
- isTruncated = true;
90
const fixedJson = fixJson(stringified.slice(0, CONSOLE_ARG_MAX_SIZE));
91
- return JSON.parse(fixedJson);
+ const json = JSON.parse(fixedJson);
+ // We only set this after JSON.parse() was successfull, so we know we didn't run into `catch`
92
+ isTruncated = true;
93
+ return json;
94
}
95
return normalizedArg;
96
} catch {
0 commit comments