Skip to content

Commit

Permalink
fix: Unhandled exception when getting value from local storage (#279)
Browse files Browse the repository at this point in the history
* fix: Unhandled exception when getting value from local storage

* convert to console.error
  • Loading branch information
tiagoapolo authored Jan 13, 2025
1 parent 12bab3c commit 84c1618
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions flagsmith-core.ts
Original file line number Diff line number Diff line change
Expand Up @@ -835,11 +835,12 @@ const Flagsmith = class {
private updateEventStorage() {
if (this.enableAnalytics) {
const events = JSON.stringify(this.getState().evaluationEvent);
AsyncStorage!.setItem(FlagsmithEvent, events);
AsyncStorage!.setItem(FlagsmithEvent, events)
.catch((e) => console.error("Flagsmith: Error setting item in async storage", e));
}
}

private evaluateFlag = (key: string, method: 'VALUE' | 'ENABLED') => {
private evaluateFlag =(key: string, method: 'VALUE' | 'ENABLED') => {
if (this.datadogRum) {
if (!this.datadogRum!.client!.addFeatureFlagEvaluation) {
console.error('Flagsmith: Your datadog RUM client does not support the function addFeatureFlagEvaluation, please update it.');
Expand Down

0 comments on commit 84c1618

Please sign in to comment.