# @ydbjs/error

> Error utilities for YDB: error classification, rich messages, and TypeScript support for robust error handling in YDB applications.

Latest version **6.0.6** (published 2026-06-01) · Apache-2.0 license · 0 weekly downloads

## Install

```sh
npm install @ydbjs/error
pnpm add @ydbjs/error
yarn add @ydbjs/error
bun add @ydbjs/error
```

## Health

**Score 70/100 (B)** — status: active.

Positive: has types; esm support; no vulnerabilities; has provenance; high maintenance score; high quality score.

Warnings: low downloads.

## Facts

| | |
|---|---|
| Version | 6.0.6 |
| Published | 2026-06-01 |
| First published | 2025-04-06 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Node | >=20.19.0 |
| Dependencies | 2 |
| Unpacked size | 12.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Provenance | attested (GitHub Actions) |
| GitHub stars | 82 |
| Author | YDB Team |
| Maintainers | ydb-platform |
| Keywords | database, error, typescript, ydb |

## Links

- npm: https://www.npmjs.com/package/@ydbjs/error
- Repository: https://github.com/ydb-platform/ydb-js-sdk
- Homepage: https://github.com/ydb-platform/ydb-js-sdk#readme
- Issues: https://github.com/ydb-platform/ydb-js-sdk/issues
- npm.io page: https://npm.io/package/@ydbjs/error

## Dependencies (2)

- [@ydbjs/api](https://npm.io/package/@ydbjs/api.md) ^6.0.7
- [@bufbuild/protobuf](https://npm.io/package/@bufbuild/protobuf.md) 2.12.0

## Alternatives

- [@sentry/react-native](https://npm.io/package/@sentry/react-native.md) — 2.6M weekly downloads
- [@ardatan/aggregate-error](https://npm.io/package/@ardatan/aggregate-error.md) — 708.1K weekly downloads
- [custom-error-generator](https://npm.io/package/custom-error-generator.md) — 2.0K weekly downloads
- [@technik-sde/prosemirror-recreate-transform](https://npm.io/package/@technik-sde/prosemirror-recreate-transform.md) — 1.5K weekly downloads
- [@suchipi/error-utils](https://npm.io/package/@suchipi/error-utils.md) — 78 weekly downloads

## Recent versions

- 6.0.6 (latest) — 2026-06-01
- 6.0.0-alpha.7 (alpha) — 2025-04-18
- 6.0.5 — 2025-11-04
- 6.0.4 — 2025-10-11
- 6.0.3 — 2025-10-11
- 6.0.2 — 2025-10-11
- 6.0.1 — 2025-10-11
- 6.0.0 — 2025-09-23
- 7.0.0-alpha.33 — 2025-09-08
- 6.0.1-alpha.32 — 2025-07-11
- 6.0.1-alpha.31 — 2025-07-09
- 6.0.1-alpha.30 — 2025-07-02
- 6.0.0-alpha.29 — 2025-06-29
- 6.0.0-alpha.28 — 2025-06-28
- 6.0.0-alpha.27 — 2025-06-28
- … 7 more at https://npm.io/package/@ydbjs/error/versions

## README

# @ydbjs/error

The `@ydbjs/error` package provides utilities for handling YDB-specific errors in JavaScript/TypeScript applications. It simplifies error classification and provides detailed error messages for better debugging and troubleshooting.

## Features

- Error classification for YDB-specific error codes
- Detailed error messages with severity levels
- TypeScript support with type definitions

## Installation

Install the package using npm:

```sh
npm install @ydbjs/error@6.0.0-alpha.2
```

## Usage

### Handling YDB Errors

```ts
import { YDBError } from '@ydbjs/error'
import { StatusIds_StatusCode } from '@ydbjs/api/operation'

try {
  throw new YDBError(StatusIds_StatusCode.ABORTED, [
    { severity: 0, issueCode: 14, message: 'Some error message' },
  ])
} catch (error) {
  if (error instanceof YDBError) {
    console.error('YDB Error:', error.message)
    console.error('Error Code:', error.code)
  }
}
```

## Development

### Building the Package

```sh
npm run build
```

### Running Tests

```sh
npm test
```

For watch mode during development:

```sh
npm run test:watch
```

## License

This project is licensed under the [Apache 2.0 License](../../LICENSE).

## Links

- [YDB Documentation](https://ydb.tech)
- [GitHub Repository](https://github.com/ydb-platform/ydb-js-sdk)
- [Issues](https://github.com/ydb-platform/ydb-js-sdk/issues)

---
_Source: https://npm.io/package/@ydbjs/error · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
