Catch relay connect errors
This commit is contained in:
@ -15,6 +15,7 @@ export class NostrSystem {
|
|||||||
* @param {string} address
|
* @param {string} address
|
||||||
*/
|
*/
|
||||||
ConnectToRelay(address, options) {
|
ConnectToRelay(address, options) {
|
||||||
|
try {
|
||||||
if (typeof this.Sockets[address] === "undefined") {
|
if (typeof this.Sockets[address] === "undefined") {
|
||||||
let c = new Connection(address, options);
|
let c = new Connection(address, options);
|
||||||
for (let s of Object.values(this.Subscriptions)) {
|
for (let s of Object.values(this.Subscriptions)) {
|
||||||
@ -22,6 +23,9 @@ export class NostrSystem {
|
|||||||
}
|
}
|
||||||
this.Sockets[address] = c;
|
this.Sockets[address] = c;
|
||||||
}
|
}
|
||||||
|
} catch (e) {
|
||||||
|
console.error(e);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
AddSubscription(sub) {
|
AddSubscription(sub) {
|
||||||
|
Reference in New Issue
Block a user