You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

@ydbjs/error

Package Overview
Dependencies
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ydbjs/error

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

6.0.1-alpha.32
latest
Source
npmnpm
Version published
Maintainers
1
Created
Source

@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:

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

Usage

Handling YDB Errors

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

npm run build

Running Tests

npm test

For watch mode during development:

npm run test:watch

License

This project is licensed under the Apache 2.0 License.

Keywords

ydb

FAQs

Package last updated on 11 Jul 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts