Fix: Missing error event

For some error responses like the ones described in #4104 the error
wasn't broadcasted to the event listeners.
This commit is contained in:
Andre Miras 2024-03-28 14:04:08 +01:00
parent ad5f1c5fc7
commit a5f0eea16f

View File

@ -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;
}