Skip to content

Commit

Permalink
feat: Modify provider RPC error log severity from error to debug
Browse files Browse the repository at this point in the history
The error middleware injected in the provider-side `json-rpc-engine` was calling `log.error()` (in practice, `log` = `console`) every time it observed a JSON-RPC error response.

We received reports that this error log is caught by the monitoring infra of some dapps. It is ultimately the caller's responsibility to handle errors where they call `ethereum.request()`, and they can always `console.error()` at that point themselves. In light of the above, we decrease the severity of our own log statement to `debug`.
  • Loading branch information
rekmarks authored May 29, 2024
1 parent 616c55f commit 1e2ed5a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ function createErrorMiddleware(
if (!error) {
return done();
}
log.error(`MetaMask - RPC Error: ${error.message}`, error);
log.debug(`MetaMask - RPC Error: ${error.message}`, error);
return done();
});
};
Expand Down

0 comments on commit 1e2ed5a

Please sign in to comment.