Blockchain Commons Components TypeScript Library - v1.0.0-alpha.13
    Preparing search index...

    Class CryptoError

    Error type for cryptographic and component operations.

    This class provides full structural parity with the Rust Error enum, including:

    • An errorKind property for programmatic error type checking
    • Structured errorData for accessing error-specific fields
    • Factory methods matching Rust's impl block

    Hierarchy

    • Error
      • CryptoError
    Index

    Properties

    errorKind: ErrorKind

    The error kind for programmatic type checking

    errorData: ErrorData

    Structured error data matching Rust's error variants

    Methods

    • Create an invalid size error.

      Rust equivalent: Error::InvalidSize { data_type, expected, actual }

      Parameters

      • expected: number

        The expected size

      • actual: number

        The actual size received

      Returns CryptoError

    • Create an invalid size error with a data type name.

      Rust equivalent: Error::invalid_size(data_type, expected, actual)

      Parameters

      • dataType: string

        The name of the data type

      • expected: number

        The expected size

      • actual: number

        The actual size received

      Returns CryptoError

    • Create an invalid data error with a data type name.

      Rust equivalent: Error::invalid_data(data_type, reason)

      Parameters

      • dataType: string

        The name of the data type

      • reason: string

        The reason the data is invalid

      Returns CryptoError

    • Create a data too short error.

      Rust equivalent: Error::data_too_short(data_type, minimum, actual)

      Parameters

      • dataType: string

        The name of the data type

      • minimum: number

        The minimum required size

      • actual: number

        The actual size received

      Returns CryptoError

    • Create an SSH agent client error.

      Rust equivalent: Error::ssh_agent_client(msg)

      Parameters

      • message: string

        Description of the SSH agent client error

      Returns CryptoError