Skip to main content
Failed requests to the service throw a subclass of CyborgDBError. The subclass is chosen from the HTTP status code, so callers can catch one class per failure mode.

Error classes

All seven classes extend CyborgDBError, which extends Error, so existing catch blocks that handle Error still catch them. Each sets name to its class name.

Properties

Retries

The SDK does not retry requests or set a request timeout. retryable marks the errors that are safe to retry; the retry loop is up to the caller:

Errors thrown before a request is sent

Argument checks that run in the SDK, before anything is sent to the service, throw CyborgDBValidationError with statusCode null. This covers:
  • an indexKey that isn’t 32 bytes, or neither indexKey nor kmsName passed to createIndex()
  • query() with neither queryVectors nor queryContents, or a Float32Array without dimension
  • malformed upsert() input, such as mismatched array lengths
  • a queryMetadata() orderBy object with more than one key

Other statuses

HTTP statuses outside the mapping above (for example 405 or 413) throw the base CyborgDBError, with statusCode set. Set the environment variable CYBORGDB_DEBUG=1 (or true) to print the full error details to stderr.