-
Notifications
You must be signed in to change notification settings - Fork 249
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
incorrectly named argument throws cryptic error when calling contract #171
Comments
This is a common developer mistake and currently can be a big devx detractor. |
In NAJ, when we receive the arguments, we can check the arguments. We need contract metadata. |
This needs design. Estimate is for following up with other teams to find out how to do this. |
Just for the record, currently, the error message is less cryptic:
Yet, it depends on how the contract itself reports the error. JSON parser in Rust provides a helpful message while JSON parser in AssemblyScript might be not that friendly. If AssemblyScript contracts still just crash without any message, we need to address it on the near-sdk-as level. That said, these are errors from inside the smart contract, these two are generated by JSON parser compiled into the contract. To do anything with that, we need to define some sort of error API layer for the smart contracts just like we discuss the events API, and come up with some helpful magic for the end-users on the SDK side. |
Downgrading to P2 since it's not
|
steps to recreate
1. use
nearlib
to call any contract method with incorrect or non-existent named argumentthe error will appear in the client-side JS console
why/where/when did this happen?
this happened by accident while following the [Zero to Hero](https://docs.nearprotocol.com/docs/tutorials/zero-to-hero) tutorial in our docs
detail
i think this is the right place to submit this since
nearlib
could handle this error gracefully but i don't see enough information in the error message to be useful to the developer.failed transaction on TestNet [here](https://explorer.nearprotocol.com/transactions/9c5JPRgKeAdWrw2GW6YChukDHJUxdSw76AQzfAgoNopV)
this error appears in the
The text was updated successfully, but these errors were encountered: