Skip to content

Commit

Permalink
Added JSON-RPC debugging on error responses.
Browse files Browse the repository at this point in the history
  • Loading branch information
ricmoo committed Feb 25, 2020
1 parent ac51a88 commit ad27600
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion packages/providers/src.ts/json-rpc-provider.ts
Expand Up @@ -253,7 +253,7 @@ export class JsonRpcProvider extends BaseProvider {
if (chainId != null) {
try {
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));
Expand Down Expand Up @@ -313,6 +313,16 @@ export class JsonRpcProvider extends BaseProvider {
});

return result;

}, (error) => {
this.emit("debug", {
action: "response",
error: error,
request: request,
provider: this
});

throw error;
});
}

Expand Down

0 comments on commit ad27600

Please sign in to comment.