Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 3 commits into from
May 30, 2024

Conversation

rekmarks
Copy link
Member

@rekmarks rekmarks commented May 29, 2024

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.

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`.
@rekmarks rekmarks requested a review from a team as a code owner May 29, 2024 21:36
src/utils.ts Outdated Show resolved Hide resolved
Co-authored-by: legobeat <109787230+legobeat@users.noreply.github.com>
@rekmarks rekmarks changed the title feat: Modify provider RPC error log severity from error to debug feat: Modify provider RPC error log severity from error to warn May 30, 2024
@rekmarks rekmarks requested review from Gudahtt and adonesky1 May 30, 2024 05:48
@rekmarks
Copy link
Member Author

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
Copy link
Contributor

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

@legobeat legobeat merged commit fdf02b8 into main May 30, 2024
18 checks passed
@legobeat legobeat deleted the rekmarks-patch-1 branch May 30, 2024 10:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants