Skip to content
Effect 4.0 is here. One ecosystem. Zero dependencies.

ConfigError

28 exports Since v2.0.0 Source

Constructors

Since v2.0.0

Signature

declare const And: (self: ConfigError, that: ConfigError) => ConfigError

Signature

declare const InvalidData: (path: Array<string>, message: string, options?: Options) => ConfigError

Signature

declare const MissingData: (path: Array<string>, message: string, options?: Options) => ConfigError
Since v2.0.0

Signature

declare const Or: (self: ConfigError, that: ConfigError) => ConfigError

Signature

declare const SourceUnavailable: (path: Array<string>, message: string, cause: Cause<unknown>, options?: Options) => ConfigError

Signature

declare const Unsupported: (path: Array<string>, message: string, options?: Options) => ConfigError

Folding

Signature

declare const reduceWithContext: {
<C, Z>(context: C, reducer: ConfigErrorReducer<C, Z>): (self: ConfigError) => Z;
<C, Z>(self: ConfigError, context: C, reducer: ConfigErrorReducer<C, Z>): Z;
}

Models

And

interface
Since v2.0.0

Signature

interface And extends Proto {
readonly _op: "And";
readonly left: ConfigError;
readonly message: string;
readonly right: ConfigError;
}
Since v2.0.0

The possible ways that loading configuration data may fail.

Signature

type ConfigError = And | Or | InvalidData | MissingData | SourceUnavailable | Unsupported
Since v2.0.0

Signature

interface ConfigErrorReducer<in C, in out Z> {
andCase(context: C, left: Z, right: Z): Z;
invalidDataCase(context: C, path: Array<string>, message: string): Z;
missingDataCase(context: C, path: Array<string>, message: string): Z;
orCase(context: C, left: Z, right: Z): Z;
sourceUnavailableCase(context: C, path: Array<string>, message: string, cause: Cause<unknown>): Z;
unsupportedCase(context: C, path: Array<string>, message: string): Z;
}

InvalidData

interface
Since v2.0.0

Signature

interface InvalidData extends Proto {
readonly _op: "InvalidData";
readonly message: string;
readonly path: Array<string>;
}

MissingData

interface
Since v2.0.0

Signature

interface MissingData extends Proto {
readonly _op: "MissingData";
readonly message: string;
readonly path: Array<string>;
}

Options

interface
Since v2.0.0

Signature

interface Options {
readonly pathDelim: string;
}

Or

interface
Since v2.0.0

Signature

interface Or extends Proto {
readonly _op: "Or";
readonly left: ConfigError;
readonly message: string;
readonly right: ConfigError;
}
Since v2.0.0

Signature

interface SourceUnavailable extends Proto {
readonly _op: "SourceUnavailable";
readonly cause: Cause<unknown>;
readonly message: string;
readonly path: Array<string>;
}

Unsupported

interface
Since v2.0.0

Signature

interface Unsupported extends Proto {
readonly _op: "Unsupported";
readonly message: string;
readonly path: Array<string>;
}

Other

Returns true if the specified ConfigError contains only MissingData errors, false otherwise.

Signature

declare const isMissingDataOnly: (self: ConfigError) => boolean

Refinements

Since v2.0.0

Returns true if the specified ConfigError is an And, false otherwise.

Signature

declare const isAnd: (self: ConfigError) => self is And

Returns true if the specified value is a ConfigError, false otherwise.

Signature

declare const isConfigError: (u: unknown) => u is ConfigError

Returns true if the specified ConfigError is an InvalidData, false otherwise.

Signature

declare const isInvalidData: (self: ConfigError) => self is InvalidData

Returns true if the specified ConfigError is an MissingData, false otherwise.

Signature

declare const isMissingData: (self: ConfigError) => self is MissingData
Since v2.0.0

Returns true if the specified ConfigError is an Or, false otherwise.

Signature

declare const isOr: (self: ConfigError) => self is Or

Returns true if the specified ConfigError is a SourceUnavailable, false otherwise.

Signature

declare const isSourceUnavailable: (self: ConfigError) => self is SourceUnavailable

Returns true if the specified ConfigError is an Unsupported, false otherwise.

Signature

declare const isUnsupported: (self: ConfigError) => self is Unsupported

Symbols

Signature

declare const ConfigErrorTypeId: unique symbol

Signature

type ConfigErrorTypeId = typeof ConfigErrorTypeId

Utils

Since v2.0.0

Signature

declare const prefixed: {
(prefix: Array<string>): (self: ConfigError) => ConfigError;
(self: ConfigError, prefix: Array<string>): ConfigError;
}