don't throw error at onSocketClose (#4363)

This commit is contained in:
Joey
2021-12-20 10:19:44 +02:00
committed by GitHub
parent 2790d1d744
commit 094382373c
+8 -1
View File
@@ -382,7 +382,14 @@ export class WsProvider implements ProviderInterface {
this.#emit('disconnected');
// reject all hanging requests
eraseRecord(this.#handlers, (h) => h.callback(error, undefined));
eraseRecord(this.#handlers, (h) => {
try {
h.callback(error, undefined);
} catch (err) {
// does not throw
l.error(err);
}
});
eraseRecord(this.#waitingForId);
if (this.#autoConnectMs > 0) {