Skip to content

Commit

Permalink
Log insertToFlagBuffer error instead of throwing
Browse files Browse the repository at this point in the history
  • Loading branch information
aliu39 committed Nov 13, 2024
1 parent fc79f4a commit 7a5f29d
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/browser/src/utils/featureFlags.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import type { FeatureFlag } from '@sentry/types';
import { logger } from '@sentry/utils';
import { DEBUG_BUILD } from '../debug-build';

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

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

0 comments on commit 7a5f29d

Please sign in to comment.