[FSSDK-12075] fix odp logging by raju-opti · Pull Request #1108 · optimizely/javascript-sdk
Pull Request Overview
This PR refactors ODP (Optimizely Data Platform) error logging to provide better context when the ODP Manager is unavailable.
- Renamed the error constant from
ODP_EVENT_FAILED_ODP_MANAGER_MISSINGto the more genericODP_MANAGER_MISSING - Updated the error message to include the calling method name as a parameter for better diagnostics
- Added comprehensive test coverage for ODP manager missing scenarios
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| lib/message/error_message.ts | Renamed constant and updated error message format to accept method name parameter |
| lib/optimizely/index.ts | Updated import and error logging calls in sendOdpEvent and fetchQualifiedSegments to use new constant with method context |
| lib/optimizely/index.spec.ts | Added test cases to verify error logging when ODP Manager is unavailable for both public API methods |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.