wasm-bindgen
wasm-bindgen copied to clipboard
Allow using `?` with `Result<T, JsValue>` in functions that return `Result<S, Box<dyn std::error::Error>>`
Motivation
For quick and dirty error handling, it's often nice to use Box<dyn std::error::Error>. This doesn't work well with wasm-bindgen, however, because JsValue doesn't implement std::error::Error
Proposed Solution
Implement std::error::Error for JsValue. Although JsValue might not always be an error, it is wasm-bindgen's error type.
Alternatives
Do nothing.