2023-07-20 04:17:05 +09:00
|
|
|
#[macro_export]
|
2024-01-20 05:57:00 +09:00
|
|
|
macro_rules! impl_napi_error_from {
|
2023-07-20 04:17:05 +09:00
|
|
|
($a:ty) => {
|
2024-01-20 05:57:00 +09:00
|
|
|
impl From<$a> for napi::Error {
|
|
|
|
fn from(reason: $a) -> napi::Error {
|
|
|
|
napi::Error::from_reason(reason.to_string())
|
2023-07-20 04:17:05 +09:00
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
}
|