Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,16 @@
skipInitialPoll: skipInitialRequest,
};
instance.setConfigurationRequestParameters(requestConfiguration);
instance.setEventDispatcher(newEventDispatcher(apiKey));

// e.g. newDefaultEventDispatcher throws an error if it cannot parse a valid event ingestion URL from the SDK key
try {
instance.setEventDispatcher(newEventDispatcher(apiKey));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed in Eppo-exp/js-sdk-common#143 to no longer throw
I'd vote removing this try/catch since it should never throw after that change

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good. I'll close this out

} catch (eventDispatcherError) {
applicationLogger.warn(
'Eppo SDK encountered an error initializing the event dispatcher, continuing initialization',
eventDispatcherError,
);
}

// We have two at-bats for initialization: from the configuration store and from fetching
// We can resolve the initialization promise as soon as either one succeeds
Expand Down Expand Up @@ -447,7 +456,7 @@
// both failed, make the "fatal" error the fetch one
initializationError = initFromFetchError;
}
} catch (error: any) {

Check warning on line 459 in src/index.ts

View workflow job for this annotation

GitHub Actions / lint-test-sdk (18)

Unexpected any. Specify a different type

Check warning on line 459 in src/index.ts

View workflow job for this annotation

GitHub Actions / lint-test-sdk (20)

Unexpected any. Specify a different type

Check warning on line 459 in src/index.ts

View workflow job for this annotation

GitHub Actions / lint-test-sdk (22)

Unexpected any. Specify a different type

Check warning on line 459 in src/index.ts

View workflow job for this annotation

GitHub Actions / lint-test-sdk (23)

Unexpected any. Specify a different type
initializationError = error;
}

Expand Down
Loading