@sentry/replay 10.71.0 → 10.72.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -5294,6 +5294,11 @@ class EventBufferSizeExceededError extends Error {
5294
5294
  super(`Event buffer exceeded maximum size of ${REPLAY_MAX_EVENT_BUFFER_SIZE}.`);
5295
5295
  }
5296
5296
  }
5297
+ class WorkerDestroyedError extends Error {
5298
+ constructor() {
5299
+ super("Worker destroyed");
5300
+ }
5301
+ }
5297
5302
 
5298
5303
  class EventBufferArray {
5299
5304
  constructor() {
@@ -5413,7 +5418,7 @@ class WorkerHandler {
5413
5418
  destroy() {
5414
5419
  DEBUG_BUILD && debug.log("Destroying compression worker");
5415
5420
  this._worker.removeEventListener("message", this._onMessage);
5416
- this._pending.forEach((pending) => pending.reject(new Error("Worker destroyed")));
5421
+ this._pending.forEach((pending) => pending.reject(new WorkerDestroyedError()));
5417
5422
  this._pending.clear();
5418
5423
  this._worker.terminate();
5419
5424
  }
@@ -5610,6 +5615,9 @@ class EventBufferProxy {
5610
5615
  await Promise.all(addEventPromises);
5611
5616
  this._fallback.clear();
5612
5617
  } catch (error) {
5618
+ if (error instanceof WorkerDestroyedError) {
5619
+ return;
5620
+ }
5613
5621
  DEBUG_BUILD && debug.exception(error, "Failed to add events when switching buffers.");
5614
5622
  }
5615
5623
  }