Skip to content

Commit

Permalink
Fix: Missing error event
Browse files Browse the repository at this point in the history
For some error responses like the ones described in ethers-io#4104 the error
wasn't broadcasted to the event listeners.
  • Loading branch information
AndreMiras committed Mar 28, 2024
1 parent ad5f1c5 commit a5f0eea
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src.ts/providers/provider-jsonrpc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit a5f0eea

Please sign in to comment.