Error handling for programs
The documentation on errors and/or handling of errors for different program types (contracts, scripts and predicates) seems sparse. It would be worthwhile noting what error codes might be expected, under what conditions and best practices for handling these erroneous conditions:
- Methods of debugging these errors.
- Methods to resolve common problems.
- Any clean up process that might need to occur.
We could link back to error codes and explain the resolutions there, or add sections for error handling to each program type.
These were the resources that I found on errors:
Contracts
https://docs.fuel.network/docs/nightly/fuels-ts/contracts/call-parameters/#gas-limit-parameter
Small section on the gasLimit related error.
Scripts
https://docs.fuel.network/docs/nightly/fuels-ts/scripts/instantiating-a-script/#instantiating-a-script
Small snippet error handling around the script request.
Predicates
https://docs.fuel.network/docs/nightly/fuels-ts/predicates/#debugging-predicates Small section on debugging predicate
https://docs.fuel.network/docs/nightly/fuels-ts/predicates/send-and-spend-funds-from-predicates/#spending-entire-predicate-held-amount
Small section on the error messages
Could you please elaborate further on "error handling for different program types"?
Maybe I'm missing context and what exactly led you to this conclusion.
@arboleya I added some more context on what I was drawing my conclusion from.
I'd like to see some more information on the common errors from contracts, scripts and predicate; and how the best way for resolving these.