MetaMask / providers

An Ethereum Provider that connects over a stream, as injected into websites by MetaMask
MIT License
224 stars 124 forks source link

feat: Modify provider RPC error log severity from `error` to `warn` #323

Closed rekmarks closed 4 months ago

rekmarks commented 4 months ago

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 warn.

rekmarks commented 4 months ago

The stretch-goal version of this would be to make logging configurable via some method on the provider object (constructor arguments don't help most of our consumers), but that's definitely a stretch goal.

legobeat commented 4 months ago

@rekmarks Going ahead and merging this to get it into next release FYI