Skip to content

strange error handling #33

@Mcdostone

Description

@Mcdostone

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions