(issue: SchemaIssue.Issue)
| 296 | ? f(resolution.value).pipe( |
| 297 | Effect.mapEager((value) => resolved(value, resolution.hasInput)), |
| 298 | Effect.mapErrorEager((error) => evaluationFailure(error, resolution.hasInput)) |
| 299 | ) |
| 300 | : Effect.succeed(resolution)) |
| 301 | ) |
| 302 | }) |
| 303 | |
| 304 | /** |
| 305 | * Provides a fallback config when parsing fails with a `ConfigError`. |
| 306 | * |
| 307 | * **When to use** |
| 308 | * |
| 309 | * Use when you need to try an alternative config source after the primary one |
| 310 | * fails. |
| 311 | * |
| 312 | * **Details** |
| 313 | * |
| 314 | * Unlike {@link withDefault}, this handles both semantic absence and **all** |
| 315 | * `ConfigError`s. The fallback function receives the error and returns a new |
| 316 | * `Config`. |
| 317 | * |
| 318 | * **Gotchas** |
| 319 | * |
| 320 | * Recovery preserves whether the primary config read provider input. When the |
| 321 | * recovered config is composed with {@link all}, invalid input in the primary |
| 322 | * branch still makes the enclosing group partially supplied, so an outer |
| 323 | * {@link withDefault} or {@link option} does not replace the whole group. |
| 324 | * |
| 325 | * **Example** (Falling back to a literal) |
| 326 | * |
| 327 | * ```ts import.meta.vitest |
| 328 | * import { Config, ConfigProvider, Effect } from "effect" |
no outgoing calls
no test coverage detected
searching dependent graphs…