firefish/packages/backend-rs/src/prelude.rs

3 lines
107 B
Rust

pub fn to_napi_error<E: ToString>(err: E) -> napi::Error {
napi::Error::from_reason(err.to_string())
}