Hyperlinkv0.8.0-beta.28

ConfigProvider

ConfigProvider.SourceErrorclasseffect/ConfigProvider.ts:199
SourceError

Typed error indicating that a configuration source could not be read.

When to use

Use when you need to report that a custom provider's underlying store is unreachable or produced an I/O error while reading configuration data.

Gotchas

Do not use SourceError for "key not found". That case is represented by returning undefined from load.

Example (Failing with a SourceError)

import { ConfigProvider, Effect } from "effect"

const provider = ConfigProvider.make((_path) =>
  Effect.fail(
    new ConfigProvider.SourceError({ message: "connection refused" })
  )
)
export class SourceError extends Data.TaggedError("SourceError")<{
  readonly message: string
  readonly cause?: unknown
}> {}
Referenced by 5 symbols