You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Oh nice catch! The error handling logic was not accounting for cases where the thrown error was a non-object. This has been fixed in 9c1beda and published on crates.io @ version 0.1.4.
Hopefully this fix is good enough for your current purposes. Unfortunately the Error that you'll get from ducc.exec("throw 'test'", ...) is just a generic one, with no visibility into 'test'. While writing mini-v8 (this crate except with V8 instead of Duktape) I discovered it was ergonomic to have an Error::Value variant so the exec caller could see—in your case—Value::String("test"). This sort of error handling should probably be ported back into ducc.
When testing JS errors I found that there is not a clear way to handle this error without the program crashing.
Rust code:
Running this code on rust 1.42.0 stable-i686-pc-windows-msvc results in:
Is there another way to wrap exec so that these errors can be handled? Thank you.
The text was updated successfully, but these errors were encountered: