napi-rs/examples/napi/src/error.rs

6 lines
139 B
Rust

use napi::bindgen_prelude::*;
#[napi]
fn throw_error() -> Result<()> {
Err(Error::new(Status::InvalidArg, "Manual Error".to_owned()))
}