Coerce anyhow::Error to NjError for node-bindgen

I want to wrap a rust function with node-bindgen to return a promise in JavaScript. The function in question returns an anyhow:Error. This is my goofy attempt: #[tokio::main] #[node_bindgen] async fn warprometo(offset: u32) -> Result<(), NjError> { Ok(crate::api::sync::coin_sync(0, true, offset, move |_height| { // }, &SYNC_CANCELED) .await?) } This results in: error[E0277]: `?` couldn’t convert… Read More Coerce anyhow::Error to NjError for node-bindgen