From a5f0eea16f9b79adf222b8c75dc2ee4f0e3656ca Mon Sep 17 00:00:00 2001 From: Andre Miras Date: Thu, 28 Mar 2024 14:04:08 +0100 Subject: [PATCH] Fix: Missing error event For some error responses like the ones described in #4104 the error wasn't broadcasted to the event listeners. --- src.ts/providers/provider-jsonrpc.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src.ts/providers/provider-jsonrpc.ts b/src.ts/providers/provider-jsonrpc.ts index 14ba6ad1b9..519980ac16 100644 --- a/src.ts/providers/provider-jsonrpc.ts +++ b/src.ts/providers/provider-jsonrpc.ts @@ -560,7 +560,9 @@ export abstract class JsonRpcApiProvider extends AbstractProvider { // The response is an error if ("error" in resp) { - reject(this.getRpcError(payload, resp)); + const error = this.getRpcError(payload, resp); + this.emit("error", error); + reject(error); continue; }