Fix stray promises when a node returns invalid results (#4118).

This commit is contained in:
Richard Moore 2023-06-06 19:24:19 -04:00
parent f37a52da28
commit 3c1bad2fb7

@ -505,7 +505,12 @@ export abstract class JsonRpcApiProvider extends AbstractProvider {
// No result; the node failed us in unexpected ways
if (resp == null) {
return reject(makeError("no response from server", "BAD_DATA", { value: result, info: { payload } }));
const error = makeError("missing response for request", "BAD_DATA", {
value: result, info: { payload }
});
this.emit("error", error);
reject(error);
continue;
}
// The response is an error