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

Consider throwing Errors VS existing fallback behavior. #7

Open
mjpowersjr opened this issue Jan 14, 2022 · 0 comments
Open

Consider throwing Errors VS existing fallback behavior. #7

mjpowersjr opened this issue Jan 14, 2022 · 0 comments

Comments

@mjpowersjr
Copy link

Today I realized that in the case of a network error, the library will log the error using console.log, and proceed to return a fallback return value.

I am using the lib to track gas pricing in a server side app, for us error handling would be cleaner if the following changes where considered:

  1. Remove the console.log statements
  2. Instead of returning a fallback value, allow any Error to bubble up to be handled downstream.

p.s. Overall this library seems to do a great job of tracking gas prices out of the box, thanks!

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

No branches or pull requests

1 participant