Hi @Mcdostone - sorry if this was already addressed, but this repo just came up in a recent search and I wanted to offer some help.
In the scenario where the return code is 0, but you've set the error in the PDK function, Rust SDK will convert that into a Rust Err variant of the Result returned. So when you call .unwrap(), this will always panic if an Err is encountered.
You would need to update your host code to check the Result returned from the plugin call and see if it is an Err and handle it directly.
Hi @Mcdostone - sorry if this was already addressed, but this repo just came up in a recent search and I wanted to offer some help.
In the scenario where the return code is
0
, but you've set the error in the PDK function, Rust SDK will convert that into a RustErr
variant of theResult
returned. So when you call.unwrap()
, this will always panic if anErr
is encountered.You would need to update your host code to check the
Result
returned from the plugin call and see if it is anErr
and handle it directly.