forked from Kieran/snort
Catch relay connect errors
This commit is contained in:
parent
af5758e522
commit
274f400c7a
@ -15,12 +15,16 @@ export class NostrSystem {
|
|||||||
* @param {string} address
|
* @param {string} address
|
||||||
*/
|
*/
|
||||||
ConnectToRelay(address, options) {
|
ConnectToRelay(address, options) {
|
||||||
if (typeof this.Sockets[address] === "undefined") {
|
try {
|
||||||
let c = new Connection(address, options);
|
if (typeof this.Sockets[address] === "undefined") {
|
||||||
for (let s of Object.values(this.Subscriptions)) {
|
let c = new Connection(address, options);
|
||||||
c.AddSubscription(s);
|
for (let s of Object.values(this.Subscriptions)) {
|
||||||
|
c.AddSubscription(s);
|
||||||
|
}
|
||||||
|
this.Sockets[address] = c;
|
||||||
}
|
}
|
||||||
this.Sockets[address] = c;
|
} catch (e) {
|
||||||
|
console.error(e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user