Skip to content

Commit

Permalink
fix: add try catch to local store (#1956)
Browse files Browse the repository at this point in the history
  • Loading branch information
hackyguru authored Apr 12, 2024
1 parent 4607d9e commit e5e8cd5
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/discovery/src/local-peer-cache/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,11 @@ export class LocalPeerCacheDiscovery
}

private savePeersToLocalStorage(): void {
localStorage.setItem("waku:peers", JSON.stringify(this.peers));
try {
localStorage.setItem("waku:peers", JSON.stringify(this.peers));
} catch (error) {
log.error("Error saving peers to local storage:", error);
}
}
}

Expand Down

0 comments on commit e5e8cd5

Please sign in to comment.