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

Add UserError WasmIndexerError code and extract an error message from WASM #1409

Closed
lostman opened this issue Oct 11, 2023 · 0 comments · Fixed by #1425
Closed

Add UserError WasmIndexerError code and extract an error message from WASM #1409

lostman opened this issue Oct 11, 2023 · 0 comments · Fixed by #1425
Assignees

Comments

@lostman
Copy link
Contributor

lostman commented Oct 11, 2023

Description

Similarly to what was done in #1402 with Panic and panic_hook, we should be able to change the indexer's handler functions' types to -> anyhow::Result<()>, and generate a wrapper which converts the Err variant into WasmIndexerError::UserError, while storing the message in a static mut String to be extracted and logged by fuel-indexer.

This would give the users another method of reporting errors, using ?. However, due to error location attribution, panicking may be preferable.

It could also be helpful for #1316.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant