This PR adds WasmIndexerError::Panic variant and registers a panic hook in the WASM indexer.
The panic message is stored in a static mutString, and an early_exit is triggered. The message is then retrieved by thy indexer service and logged.
Testing steps
CI tests should pass.
For manual testing, deploy an indexer that causes panic (for instance, by calling unwrap() on the None value in the handler function), and observe the panic error message in the logs of fuel-indexer.
Changelog
Add WasmIndexerError::Panic
Generate code to store and retrieve panic messages in the WASM.
Add get_panic_message function to Executor trait. For native executor, it always returns an error.
Description
Closes #1402.
This PR adds
WasmIndexerError::Panic
variant and registers apanic
hook in theWASM
indexer.The panic message is stored in a
static mut
String
, and anearly_exit
is triggered. The message is then retrieved by thy indexer service and logged.Testing steps
CI tests should pass.
For manual testing, deploy an indexer that causes
panic
(for instance, by callingunwrap()
on theNone
value in the handler function), and observe the panic error message in the logs offuel-indexer
.Changelog
WasmIndexerError::Panic
panic
messages in theWASM
.get_panic_message
function toExecutor
trait. For native executor, it always returns an error.