Catch relay connect errors

This commit is contained in:
2023-01-06 14:59:59 +00:00
parent af5758e522
commit 274f400c7a

View File

@ -15,6 +15,7 @@ export class NostrSystem {
* @param {string} address
*/
ConnectToRelay(address, options) {
try {
if (typeof this.Sockets[address] === "undefined") {
let c = new Connection(address, options);
for (let s of Object.values(this.Subscriptions)) {
@ -22,6 +23,9 @@ export class NostrSystem {
}
this.Sockets[address] = c;
}
} catch (e) {
console.error(e);
}
}
AddSubscription(sub) {