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

More actionable error message for "Incorrect number of arguments" #118

Closed
emergent-reasons opened this issue May 11, 2022 · 2 comments
Closed
Labels
enhancement New feature or request good first issue Good for newcomers javascript-sdk Relates to the CashScript JavaScript SDK

Comments

@emergent-reasons
Copy link
Contributor

Example:

Incorrect number of arguments passed to AnyHedge_v0_11 constructor

Would be nice to have

Expected x arguments for y constructor but got z

or

X unexpected arguments and Y missing arguments passed to ... constructor

or any format that works.

@rkalis rkalis added enhancement New feature or request javascript-sdk Relates to the CashScript JavaScript SDK good first issue Good for newcomers labels Jun 13, 2022
@mr-zwets
Copy link
Member

Just made a commit to the @next branch to improve the error message to provide more info 👍

Now it returns the error in this format:

Incorrect number of arguments passed to function spend. Expected 2 arguments (pubkey,sig) but got 0

Note that this is not exactly the suggested format as it's not trivial to return the provided types (because the provided types would be JS types instead of CashScript types).

I think we can close this old issue now, should it come up again we can reopen it 😄

@emergent-reasons
Copy link
Contributor Author

Looks great!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers javascript-sdk Relates to the CashScript JavaScript SDK
Projects
None yet
Development

No branches or pull requests

3 participants