Closed MindPatch closed 2 years ago
Hi,
The way to return errors from Rust functions is to return the Error::ExternalError
variant instead of unwrapping. There are some (admittedly buried) examples in the test suite, e.g. https://github.com/amethyst/rlua/blob/master/tests/tests.rs#L231
If reqwest::Error
isn't directly convertible to Box<Error + Send + Sync
then you may need to convert it yourself.
Thank you
it would be better if you provide some examples of error handling, because I've some questions about this in my case I'm trying to create a lua function to send a http request to custom url, but it may return an error message but your crate cannot add
Err
to thelua_context.create_function
function