@blockchaincommons/components - v1.0.0-beta.4
    Preparing search index...

    Class ComponentsError

    Error raised by every component operation.

    try {
    Digest.from(bytes);
    } catch (e) {
    if (ComponentsError.isComponentsError(e) && e.code === "InvalidSize") {
    console.log(e.details.expected, e.details.actual);
    }
    }

    Hierarchy

    • Error
      • ComponentsError
    Index
    name: "ComponentsError"

    Always "ComponentsError"; the cross-copy identity isComponentsError checks.

    The failure code.

    Structured details, discriminated by code.

    • InvalidSize: invalid <dataType> size: expected <expected>, got <actual>, with the reference's data_type ("digest", "nonce", "symmetric key", "ECDSA public key", …).

      Parameters

      • dataType: string
      • expected: number
      • actual: number

      Returns ComponentsError

    • InvalidData naming the type or parameter.

      Parameters

      • dataType: string
      • reason: string
      • Optionalcause: unknown

      Returns ComponentsError

    • DataTooShort: fewer bytes than the type's minimum.

      Parameters

      • dataType: string
      • minimum: number
      • actual: number

      Returns ComponentsError

    • InvalidData for a malformed text form (an SSH PEM, a URI).

      Parameters

      • reason: string
      • Optionalcause: unknown

      Returns ComponentsError

    • Crypto: a cryptographic operation failed (authentication, signing).

      Parameters

      • message: string
      • Optionalcause: unknown

      Returns ComponentsError

    • Cbor with the CBOR error: prefix: a dcbor failure inside an operation whose reference error type is the component Error (Error::Cbor), or a dcbor failure met outside a decoder.

      Parameters

      • message: string
      • Optionalcause: unknown

      Returns ComponentsError

    • Cbor as a decoder reports it: the message is the dcbor Display of cause with no prefix, as the reference's from_tagged_cbor returns a dcbor::Error; cause is that CborError.

      Parameters

      • cause: Error

      Returns ComponentsError

    • Ssh: an SSH key, signature or certificate could not be parsed or used.

      Parameters

      • message: string
      • Optionalcause: unknown

      Returns ComponentsError

    • Compression: a DEFLATE stream or its checksum is corrupt.

      Parameters

      • message: string
      • Optionalcause: unknown

      Returns ComponentsError

    • PostQuantum: an ML-DSA / ML-KEM level or key is invalid.

      Parameters

      • message: string
      • Optionalcause: unknown

      Returns ComponentsError

    • Hex: a malformed hex string (hex decoding error: <reason>, the hex crate's texts).

      Parameters

      • message: string
      • Optionalcause: unknown

      Returns ComponentsError

    • Utf8: bytes that are not valid UTF-8 (UTF-8 conversion error: <reason>).

      Parameters

      • message: string
      • Optionalcause: unknown

      Returns ComponentsError

    • Env: an environment variable an SSH-agent transport needs is missing or unreadable.

      Parameters

      • message: string
      • Optionalcause: unknown

      Returns ComponentsError

    • SshAgentClient: the SSH-agent transport failed (socket, protocol).

      Parameters

      • message: string
      • Optionalcause: unknown

      Returns ComponentsError