Allow using ?
with Result<T, JsValue>
in functions that return Result<S, Box<dyn std::error::Error>>
#2994
Labels
Motivation
For quick and dirty error handling, it's often nice to use
Box<dyn std::error::Error>
. This doesn't work well withwasm-bindgen
, however, becauseJsValue
doesn't implementstd::error::Error
Proposed Solution
Implement
std::error::Error
forJsValue
. AlthoughJsValue
might not always be an error, it iswasm-bindgen
's error type.Alternatives
Do nothing.
The text was updated successfully, but these errors were encountered: