mirror of https://github.com/status-im/js-waku.git
fix: add try catch to local store (#1956)
This commit is contained in:
parent
4607d9ea86
commit
e5e8cd5e17
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue