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

    Class KnownValuesError

    Thrown for an argument outside its domain (InvalidParameter, JS-only), a registry file that cannot be read (Io) or parsed (Json), and a directory configuration changed after the global store was built (AlreadyInitialized). Branch on code; the messages of the last three are the reference's Display strings.

    Instances come from the static factories only.

    try {
    setDirectoryConfig(new DirectoryConfig());
    } catch (e) {
    if (KnownValuesError.isKnownValuesError(e) && e.is("AlreadyInitialized")) {
    // the global store has already been built
    }
    }

    Hierarchy

    • Error
      • KnownValuesError
    Index
    name: "KnownValuesError"

    Always "KnownValuesError"; the cross-copy identity KnownValuesError.isKnownValuesError checks.

    The discriminant; equals details.code.

    The structured payload.

    • A registry file that does not parse; message is the reference's text (the serde_json message, prefixed by the loader with the file).

      Parameters

      • message: string

      Returns KnownValuesError

    • Whether x is a KnownValuesError, from this module copy or another (a CommonJS and an ESM copy in one process): checks the name and the presence of code, not instanceof.

      Parameters

      • x: unknown

      Returns x is KnownValuesError