feat(nodejs): catch unwinds in node bindings (#1414)

this bumps napi version to 2.16 which contains a few bug fixes.
Additionally, it adds `catch_unwind` to any method that may
unintentionally panic.

`catch_unwind` will unwind the panics and return a regular JS error
instead of panicking.
This commit is contained in:
Cory Grinstead
2024-07-01 09:28:10 -05:00
committed by GitHub
parent ccded130ed
commit b8a1719174
8 changed files with 38 additions and 38 deletions

View File

@@ -30,7 +30,7 @@ impl RecordBatchIterator {
Self { inner }
}
#[napi]
#[napi(catch_unwind)]
pub async unsafe fn next(&mut self) -> napi::Result<Option<Buffer>> {
if let Some(rst) = self.inner.next().await {
let batch = rst.map_err(|e| {