Added JSON-RPC debugging on error responses.
This commit is contained in:
parent
ac51a88c29
commit
ad27600c69
@ -253,7 +253,7 @@ export class JsonRpcProvider extends BaseProvider {
|
|||||||
if (chainId != null) {
|
if (chainId != null) {
|
||||||
try {
|
try {
|
||||||
return resolve(getNetwork(BigNumber.from(chainId).toNumber()));
|
return resolve(getNetwork(BigNumber.from(chainId).toNumber()));
|
||||||
} catch (error) { console.log("e3", error); }
|
} catch (error) { }
|
||||||
}
|
}
|
||||||
|
|
||||||
reject(logger.makeError("could not detect network", Logger.errors.NETWORK_ERROR));
|
reject(logger.makeError("could not detect network", Logger.errors.NETWORK_ERROR));
|
||||||
@ -313,6 +313,16 @@ export class JsonRpcProvider extends BaseProvider {
|
|||||||
});
|
});
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
|
|
||||||
|
}, (error) => {
|
||||||
|
this.emit("debug", {
|
||||||
|
action: "response",
|
||||||
|
error: error,
|
||||||
|
request: request,
|
||||||
|
provider: this
|
||||||
|
});
|
||||||
|
|
||||||
|
throw error;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user