From cb0f336207de1819847db904c7fa7bae2ac62054 Mon Sep 17 00:00:00 2001 From: Sai Kumar Battinoju Date: Fri, 3 Jan 2025 08:46:03 +0530 Subject: [PATCH] chore: minor improvements 2 --- .../components/capabilitiesManager/CapabilitiesManager.ts | 6 +----- .../src/components/eventRepository/EventRepository.ts | 1 - 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/packages/analytics-js/src/components/capabilitiesManager/CapabilitiesManager.ts b/packages/analytics-js/src/components/capabilitiesManager/CapabilitiesManager.ts index e2d1dd664..10de4c547 100644 --- a/packages/analytics-js/src/components/capabilitiesManager/CapabilitiesManager.ts +++ b/packages/analytics-js/src/components/capabilitiesManager/CapabilitiesManager.ts @@ -205,11 +205,7 @@ class CapabilitiesManager implements ICapabilitiesManager { * @param error The error object */ onError(error: unknown): void { - if (this.errorHandler) { - this.errorHandler.onError(error, CAPABILITIES_MANAGER); - } else { - throw error; - } + this.errorHandler.onError(error, CAPABILITIES_MANAGER); } } diff --git a/packages/analytics-js/src/components/eventRepository/EventRepository.ts b/packages/analytics-js/src/components/eventRepository/EventRepository.ts index d89c9096e..9ad9a6f8f 100644 --- a/packages/analytics-js/src/components/eventRepository/EventRepository.ts +++ b/packages/analytics-js/src/components/eventRepository/EventRepository.ts @@ -211,7 +211,6 @@ class EventRepository implements IEventRepository { * Handles error * @param error The error object * @param customMessage a message - * @param shouldAlwaysThrow if it should throw or use logger */ onError(error: unknown, customMessage?: string): void { if (this.errorHandler) {