Task description
The interpreter and wasm-chain integration often use anyhow::Error as an error type. This is for historical reasons since during initial development this is most flexible. We then use downcast to identify whether specific errors, such as OutOfEnergy occurred. We also have a number of other concrete errors that I needed during testing. Still there are some remaining errors that are just bail!("arbitrary string").
The ideal way of doing error handling is that each of the library methods (i.e., all of parsing, validation, interpreter) would return a precise error, which would be an enum. anyhow::Error should only be used in cargo-concordium at the application level.
This task is to get to this point.
Sub-tasks
This will make error handling more robust. In particular with the current setup checking whether execution failed with out of energy, or whether it failed for some other reason is not clean and transparent.
Task description
The interpreter and wasm-chain integration often use anyhow::Error as an error type. This is for historical reasons since during initial development this is most flexible. We then use
downcastto identify whether specific errors, such as OutOfEnergy occurred. We also have a number of other concrete errors that I needed during testing. Still there are some remaining errors that are justbail!("arbitrary string").The ideal way of doing error handling is that each of the library methods (i.e., all of parsing, validation, interpreter) would return a precise error, which would be an enum. anyhow::Error should only be used in cargo-concordium at the application level.
This task is to get to this point.
Sub-tasks
This will make error handling more robust. In particular with the current setup checking whether execution failed with out of energy, or whether it failed for some other reason is not clean and transparent.