BC-DCBOR TypeScript Library - v1.0.0-alpha.13
    Preparing search index...

    Class CborError

    Typed error class for all CBOR-related errors.

    Wraps the discriminated union Error type in a JavaScript Error object for proper error handling with stack traces.

    throw new CborError({ type: 'Underrun' });
    throw new CborError({ type: 'WrongTag', expected: tag1, actual: tag2 });

    Hierarchy

    • Error
      • CborError
    Index

    Constructors

    Properties

    Methods

    Constructors

    • Create a new CborError.

      Parameters

      • errorType: Error

        The discriminated union error type

      • Optionalmessage: string

        Optional custom message (defaults to errorToString(errorType))

      Returns CborError

    Properties

    errorType: Error

    The structured error information.

    Methods

    • Check if an error is a CborError.

      Parameters

      • error: unknown

        Error to check

      Returns error is CborError

      True if error is a CborError