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

@@ -62,7 +62,7 @@ impl Query {
Ok(VectorQuery { inner })
}
#[napi]
#[napi(catch_unwind)]
pub async fn execute(
&self,
max_batch_length: Option<u32>,
@@ -136,7 +136,7 @@ impl VectorQuery {
self.inner = self.inner.clone().limit(limit as usize);
}
#[napi]
#[napi(catch_unwind)]
pub async fn execute(
&self,
max_batch_length: Option<u32>,