-
Notifications
You must be signed in to change notification settings - Fork 16
strange error handling #33
Copy link
Copy link
Closed
Description
Hi,
I've been using extism to implement a plugin system in a rust project and I'm facing a strange behavior regarding error handling when calling a extism plugin function generated with golang. To be honest, I don't know if the issue comes from the rust Extism library or the go-pdk library.
According to the documentation of this library:
An Extism export expects an i32 return code. 0 is success and 1 is a failure.
For some reasons, returningint32 different from 0 doesn't mean the wasm function failed for the rust host program.
Here is the repo to reproduce the steps: https://github.com/Mcdostone/go-pdk-error-handling
| returned code | setError |
Host | expected | actual |
|---|---|---|---|---|
| 0 | false |
rust | no error | no error |
| 0 | false |
extism CLI | no error | no error |
| 0 | true |
rust | ? | panic |
| 0 | true |
extism CLI | ? | no error |
| 500 | false |
rust | panic | no error |
| 500 | false |
extism CLI | panic | panic |
Let me know if you have any questions.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels