mirror of
https://github.com/lancedb/lancedb.git
synced 2026-12-03 07:45:17 +00:00
## Summary The Node SDK now throws typed `LanceError` subclasses instead of one generic `Error` with an indented `Caused by` string. Fixes #222 ## Before / after ```ts try { await db.openTable(\"missing\"); } catch (error) { if (error instanceof TableNotFoundError) { error.code; // \"TableNotFound\" error.tableName; // \"missing\" error.message; // \"Table 'missing' was not found\" error.cause; // underlying dataset error } } ``` ## Changes - `nodejs/src/error.rs` — map each `lancedb::Error` variant to a one-line header + `error.cause` - `nodejs/src/query.rs`, `nodejs/src/merge.rs` — pass errors through instead of stringifying - `nodejs/lancedb/errors.ts`, `errors_install.ts` — real subclasses when the package loads - Tests + generated API docs under `docs/src/js/` ## Test plan - [x] Native debug build, `tsc`, Biome, `cargo clippy -p lancedb-nodejs` - [x] Jest: new error tests, remote retry, connection/query/table (594 passed) ## Notes Node-API cannot construct a custom `Error` subclass from an async Rust rejection, so translation happens in JS when `@lancedb/lancedb` loads. Calling the raw native addon without that entrypoint still shows the header line. --------- Signed-off-by: ZYZ666-RGB <1991039819@qq.com> Signed-off-by: yuzhou <1991039819@qq.com> Co-authored-by: Xuanwo <github@xuanwo.io>
6.3 KiB
6.3 KiB
@lancedb/lancedb • Docs
@lancedb/lancedb / NotSupportedError
Class: NotSupportedError
The operation is not implemented for this table or build.
Extends
Constructors
new NotSupportedError()
new NotSupportedError(message, options?): NotSupportedError
Parameters
-
message:
string -
options?:
LanceErrorOptions
Returns
Inherited from
Properties
cause?
optional cause: unknown;
Inherited from
code
readonly code: string;
Inherited from
columnName?
readonly optional columnName: string;
Inherited from
connectFailures?
readonly optional connectFailures: number;
Inherited from
databaseName?
readonly optional databaseName: string;
Inherited from
errorCode?
readonly optional errorCode: string;
Inherited from
functionName?
readonly optional functionName: string;
Inherited from
grpcCode?
readonly optional grpcCode: number;
Inherited from
indexName?
readonly optional indexName: string;
Inherited from
jobId?
readonly optional jobId: string;
Inherited from
jobRequestId?
readonly optional jobRequestId: string;
Inherited from
maxConnectFailures?
readonly optional maxConnectFailures: number;
Inherited from
maxReadFailures?
readonly optional maxReadFailures: number;
Inherited from
maxRequestFailures?
readonly optional maxRequestFailures: number;
Inherited from
message
message: string;
Inherited from
name
name: string;
Inherited from
namespacePath?
readonly optional namespacePath: string[];
Inherited from
path?
readonly optional path: string;
Inherited from
phase?
readonly optional phase: string;
Inherited from
readFailures?
readonly optional readFailures: number;
Inherited from
requestFailures?
readonly optional requestFailures: number;
Inherited from
requestId?
readonly optional requestId: string;
Inherited from
resourceKind?
readonly optional resourceKind: string;
Inherited from
resourceName?
readonly optional resourceName: string;
Inherited from
retryable?
readonly optional retryable: boolean;
Inherited from
sqlJobId?
readonly optional sqlJobId: string;
Inherited from
stack?
optional stack: string;
Inherited from
statusCode?
readonly optional statusCode: number;
Inherited from
tableName?
readonly optional tableName: string;
Inherited from
code
readonly static code: "NotSupported" = "NotSupported";
Overrides
prepareStackTrace()?
static optional prepareStackTrace: (err, stackTraces) => any;
Optional override for formatting stack traces
Parameters
-
err:
Error -
stackTraces:
CallSite[]
Returns
any
See
https://v8.dev/docs/stack-trace-api#customizing-stack-traces
Inherited from
stackTraceLimit
static stackTraceLimit: number;
Inherited from
Methods
captureStackTrace()
static captureStackTrace(targetObject, constructorOpt?): void
Create .stack property on a target object
Parameters
-
targetObject:
object -
constructorOpt?:
Function
Returns
void