gas-estimation icon indicating copy to clipboard operation
gas-estimation copied to clipboard

Consider throwing Errors VS existing fallback behavior.

Open mjpowersjr opened this issue 4 years ago • 0 comments

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!

mjpowersjr avatar Jan 14 '22 20:01 mjpowersjr