handle errors when sending pings
This commit is contained in:
@@ -103,8 +103,10 @@ export function connectServers(config: typeof defaultConfig): void {
|
||||
export function reconnectServers(config: typeof defaultConfig): void {
|
||||
config.connectedServers
|
||||
.map(address => address.replace("ws", "http"))
|
||||
.forEach(address => {
|
||||
fetch(address);
|
||||
.forEach(async address => {
|
||||
try {
|
||||
await fetch(address);
|
||||
} catch (error) { writeError(`failed to ping server at "${address}": ${error}`) }
|
||||
});
|
||||
|
||||
[...serversDisconnected.values()].forEach((address) => {
|
||||
|
||||
Reference in New Issue
Block a user