Skip to content

Commit 06d041a

Browse files
author
Luca Forstner
committed
catch promise
1 parent d3e8dc0 commit 06d041a

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

packages/replay/src/eventBuffer/EventBufferCompressionWorker.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
import type { ReplayRecordingData } from '@sentry/types';
22

3+
import { logger } from '@sentry/utils';
34
import { REPLAY_MAX_EVENT_BUFFER_SIZE } from '../constants';
5+
import { DEBUG_BUILD } from '../debug-build';
46
import type { AddEventResult, EventBuffer, EventBufferType, RecordingEvent } from '../types';
57
import { timestampToMs } from '../util/timestamp';
68
import { WorkerHandler } from './WorkerHandler';
@@ -85,9 +87,9 @@ export class EventBufferCompressionWorker implements EventBuffer {
8587
this.hasCheckout = false;
8688

8789
// We do not wait on this, as we assume the order of messages is consistent for the worker
88-
// This should never reject
89-
// eslint-disable-next-line @typescript-eslint/no-floating-promises
90-
this._worker.postMessage('clear');
90+
this._worker.postMessage('clear').then(null, e => {
91+
DEBUG_BUILD && logger.warn('[Replay] Sending "clear" message to worker failed', e);
92+
});
9193
}
9294

9395
/** @inheritdoc */

0 commit comments

Comments
 (0)