We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
It would be great if we could throw exception from rust..
#[deno_bindgen] pub fn div(a: i32,b: i32)-> i32 { if b==0 { deno_bindgen::throw("cannot divide by zero") } else { a/b } }
And an Exception trait would be great just like wasm_bindgen
wasm_bindgen
trait Exception<T> { fn unrwap_or_throw(self)-> T; } impl<T,E> Exception<T> for Result<T,E> {...} impl<T> Exception<T> for Option<T> {...} #[deno_bindgen] pub fn read(path: &str)-> String { std::fs::read_to_string(path).unwrap_or_throw() }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
It would be great if we could throw exception from rust..
And an Exception trait would be great just like
wasm_bindgen
The text was updated successfully, but these errors were encountered: