effect-io-ai

Package: effect
Module: ConfigProvider

ConfigProvider.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" })
  )
)

See

Signature

declare class SourceError

Source

Since v4.0.0