2021-09-24 10:46:27 +09:00
|
|
|
use napi::bindgen_prelude::*;
|
|
|
|
|
|
|
|
#[napi]
|
2022-08-20 00:36:36 +09:00
|
|
|
pub fn throw_error() -> Result<()> {
|
2021-09-24 10:46:27 +09:00
|
|
|
Err(Error::new(Status::InvalidArg, "Manual Error".to_owned()))
|
|
|
|
}
|
2022-08-20 00:36:36 +09:00
|
|
|
|
|
|
|
#[napi(catch_unwind)]
|
|
|
|
pub fn panic() {
|
|
|
|
panic!("Don't panic");
|
|
|
|
}
|