Skip to content

Commit 84c1618

Browse files
authored
fix: Unhandled exception when getting value from local storage (#279)
* fix: Unhandled exception when getting value from local storage * convert to console.error
1 parent 12bab3c commit 84c1618

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

flagsmith-core.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -835,11 +835,12 @@ const Flagsmith = class {
835835
private updateEventStorage() {
836836
if (this.enableAnalytics) {
837837
const events = JSON.stringify(this.getState().evaluationEvent);
838-
AsyncStorage!.setItem(FlagsmithEvent, events);
838+
AsyncStorage!.setItem(FlagsmithEvent, events)
839+
.catch((e) => console.error("Flagsmith: Error setting item in async storage", e));
839840
}
840841
}
841842

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

0 commit comments

Comments
 (0)