Skip to content

Improve error handling#91

Merged
jbourassa merged 3 commits intomainfrom
improve-error-handling
Dec 20, 2022
Merged

Improve error handling#91
jbourassa merged 3 commits intomainfrom
improve-error-handling

Conversation

@jbourassa
Copy link
Copy Markdown
Collaborator

  • Refactor: remove the need to hold host exception on the store, downcast the exception instead.
  • Add missing trap codes for Wasm traps.
  • Improve experience of param and result
    • Introduce a new ResultError for when a host call's result can't be converted. The exception message contains Proc#inspect -- it's verbose but I suspect this will help a lot when debugging.
    • Change Wasmtime::Error to ArgumentError when calling a Wasm function with incorrect arity.
    • Specify which param or result failed to convert by adding its index to the error message.

We don't need to manually keep track of the host call's error,
downcasting the anyhow error works just fine.
@jbourassa jbourassa merged commit a7af259 into main Dec 20, 2022
@jbourassa jbourassa deleted the improve-error-handling branch December 20, 2022 16:41
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 this pull request may close these issues.

1 participant