Skip to content

Commit 97767d4

Browse files
committed
add log for body parsing error
1 parent ae7b106 commit 97767d4

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

packages/replay/src/coreHandlers/util/networkUtils.ts

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import type { TextEncoderInternal } from '@sentry/types';
2-
import { dropUndefinedKeys, stringMatchesSomePattern } from '@sentry/utils';
2+
import { dropUndefinedKeys, logger, stringMatchesSomePattern } from '@sentry/utils';
33

44
import { NETWORK_BODY_MAX_SIZE, WINDOW } from '../../constants';
55
import type {
@@ -74,7 +74,9 @@ export function getBodyString(body: unknown): string | undefined {
7474
if (body instanceof FormData) {
7575
return _serializeFormData(body);
7676
}
77-
} catch {} // eslint-disable-line no-empty
77+
} catch {
78+
__DEBUG_BUILD__ && logger.warn('[Replay] Failed to serialize body', body);
79+
}
7880

7981
return undefined;
8082
}

0 commit comments

Comments
 (0)