Skip to content

Commit 7a5f29d

Browse files
committed
Log insertToFlagBuffer error instead of throwing
1 parent fc79f4a commit 7a5f29d

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

packages/browser/src/utils/featureFlags.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
import type { FeatureFlag } from '@sentry/types';
2+
import { logger } from '@sentry/utils';
3+
import { DEBUG_BUILD } from '../debug-build';
24

35
/**
46
* Ordered LRU cache for storing feature flags in the scope context. The name
@@ -32,7 +34,8 @@ export function insertToFlagBuffer(
3234
maxSize: number = FLAG_BUFFER_SIZE,
3335
): void {
3436
if (flags.length > maxSize) {
35-
throw Error(`insertToFlagBuffer called on a buffer larger than the given maxSize=${maxSize}`);
37+
DEBUG_BUILD && logger.error(`insertToFlagBuffer called on a buffer larger than the given maxSize=${maxSize}`);
38+
return;
3639
}
3740

3841
// Check if the flag is already in the buffer - O(n)

0 commit comments

Comments
 (0)