ethers-error-parser icon indicating copy to clipboard operation
ethers-error-parser copied to clipboard

feat: add error parsing for the invalid argument type

Open challet opened this issue 1 year ago • 2 comments

Is your pull request closing an issue?

Please explain the main changes of your pull request

Handles INVALID_ARGUMENT error type which can be thrown for instance by the getAddress method.

Checklist

  • [x] Have you added any new returned codes to the README file ?
  • [x] Have you added new tests for your change?

challet avatar Mar 09 '23 18:03 challet

Codecov Report

Merging #47 (7e5bbfe) into main (f9dc429) will not change coverage. The diff coverage is 100.00%.

:mega: This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more

@@            Coverage Diff            @@
##              main       #47   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            7         7           
  Lines          666       691   +25     
  Branches        79        81    +2     
=========================================
+ Hits           666       691   +25     
Impacted Files Coverage Δ
lib/__tests__/getParsedEthersError.test.ts 100.00% <100.00%> (ø)
lib/constants.ts 100.00% <100.00%> (ø)
lib/utils/getTopLevelKnownError.ts 100.00% <100.00%> (ø)

:mega: We’re building smart automated test selection to slash your CI/CD build times. Learn more

codecov-commenter avatar Mar 09 '23 18:03 codecov-commenter

Hi, I'm not sure this is the way to go since, in that case, the original error has more data (especially the argument property which could be programmatically used). Making this PR to open the discussion. As an alternative, could it be considered that some ethers error should be kept as they are ? Or maybe to add an extra property to the ReturnValue to hold a context object ?

challet avatar Mar 09 '23 18:03 challet