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: enhance errors for methods fail #4745

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

anonkey
Copy link

@anonkey anonkey commented May 28, 2024

Hi,
Error for methods/arguments fails doesn't give a lot of details

     error = new TypeError(message);
                    ^
TypeError: unsupported addressable value (argument="target", value=null, code=INVALID_ARGUMENT, version=6.12.1)
    at makeError (/SOMEPROJECT/node_modules/ethers/src.ts/utils/errors.ts:687:21)
    at assert (/SOMEPROJECT/node_modules/ethers/src.ts/utils/errors.ts:715:25)
    at assertArgument (/SOMEPROJECT/node_modules/ethers/src.ts/utils/errors.ts:727:5)
    at resolveAddress (/SOMEPROJECT/node_modules/ethers/src.ts/address/checks.ts:122:19)
    at /SOMEPROJECT/node_modules/ethers/src.ts/contract/contract.ts:174:12
    at ParamType.#walkAsync (/SOMEPROJECT/node_modules/ethers/src.ts/abi/fragments.ts:779:24)
    at ParamType.walkAsync (/SOMEPROJECT/node_modules/ethers/src.ts/abi/fragments.ts:797:24)
    at /SOMEPROJECT/node_modules/ethers/src.ts/contract/contract.ts:171:21
    at Array.map (<anonymous>)
    at resolveArgs (/SOMEPROJECT/node_modules/ethers/src.ts/contract/contract.ts:170:37) {
  code: 'INVALID_ARGUMENT',
  argument: 'target',
  value: undefined,
  shortMessage: 'unsupported addressable value'
}

Added method name and argument name to error message

@ricmoo ricmoo added on-deck This Enhancement or Bug is currently being worked on. v6 Issues regarding v6 next-patch Issues scheduled for the next arch release. labels May 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
next-patch Issues scheduled for the next arch release. on-deck This Enhancement or Bug is currently being worked on. v6 Issues regarding v6
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants