@blockchaincommons/uniform-resources - v1.0.0-beta.3
    Preparing search index...

    Thrown for malformed UR strings (InvalidScheme, TypeUnspecified, InvalidType, NotSinglePart), a type other than the one expected (UnexpectedType), a bytewords failure in decodeBytewords (Bytewords), CBOR failures (Cbor), anything the reference's ur crate rejects inside a UR string or a part (Decoder: bytewords inside a UR string, the header, the part CBOR, the fountain decoder), an argument outside its domain (InvalidParameter) and a tag with no name to build a UR type from (TagUnnamed). Codes and messages are the reference's wherever it has an outcome; branch on code.

    Instances come from the static factories only; a wrapped CBOR or part error is the cause.

    try {
    UR.parse(s);
    } catch (e) {
    if (URError.isURError(e) && e.is("UnexpectedType")) {
    // e.details.expected, e.details.found
    }
    }

    Hierarchy

    • Error
      • URError
    Index
    name: "URError"

    Always "URError"; the cross-copy identity URError.isURError checks.

    The discriminant; equals details.code.

    The structured payload, discriminated by code.

    • Type guard for a URError, including one from another copy of this package.

      Parameters

      • value: unknown

      Returns value is URError

    • A well-formed multipart header where a single-part UR was required.

      Returns URError

    • The UR's type is found where expected was required.

      Parameters

      • expected: string
      • found: string

      Returns URError

    • A decodeBytewords failure, in the reference's words.

      Parameters

      • message: string

      Returns URError

    • A CBOR failure; the dcbor error is the cause when one was caught.

      Parameters

      • message: string
      • Optionalcause: unknown

      Returns URError

    • Anything the reference's ur crate rejects, in its words (its Error::UR).

      Parameters

      • message: string
      • Optionalcause: unknown

      Returns URError

    • parameter must be requirement; value is what was received, rendered exactly.

      Parameters

      • parameter: string
      • value: unknown
      • requirement: string

      Returns URError

    • tag has no registered name, or (undefined) the codec has no tag at all.

      Parameters

      • tag: CborNumber | undefined

      Returns URError