napi-rs/crates/napi/src/bindgen_runtime/error.rs
2022-05-06 18:03:04 +08:00

10 lines
276 B
Rust

#[doc(hidden)]
#[macro_export]
macro_rules! check_status_or_throw {
($env:expr, $code:expr, $($msg:tt)*) => {
if let Err(e) = $crate::check_status!($code, $($msg)*) {
#[allow(unused_unsafe)]
unsafe { $crate::JsError::from(e).throw_into($env) };
}
};
}