From 441042235f0a51aba0837edc55b0b72864bca22f Mon Sep 17 00:00:00 2001 From: Honza Dvorsky Date: Wed, 24 Sep 2025 22:37:15 +0100 Subject: [PATCH] [Docs] Remove obsolete example about catching ConfigError --- .../Guides/Choosing-reader-methods.md | 19 ------------------- 1 file changed, 19 deletions(-) diff --git a/Sources/Configuration/Documentation.docc/Guides/Choosing-reader-methods.md b/Sources/Configuration/Documentation.docc/Guides/Choosing-reader-methods.md index 7b3b08f..a288edc 100644 --- a/Sources/Configuration/Documentation.docc/Guides/Choosing-reader-methods.md +++ b/Sources/Configuration/Documentation.docc/Guides/Choosing-reader-methods.md @@ -169,25 +169,6 @@ Use required variants when: - **Critical functionality**: Configuration that must be present for core features to work. - **Fail-fast behavior**: You want immediate errors for missing critical configuration. -#### Error types - -Required variants throw specific errors for different failure scenarios: - -```swift -do { - let port = try config.requiredInt(forKey: "server.port") -} catch ConfigError.missingRequiredConfigValue(let key) { - // The configuration key wasn't found in any provider - print("Missing required config: \(key)") -} catch ConfigError.configValueNotConvertible(let name, let type) { - // The value exists but can't be converted to the expected type - print("Config '\(name)' can't convert to \(type)") -} catch { - // Provider-specific errors (network issues, file not found, etc.) - print("Provider error: \(error)") -} -``` - ### Choosing the right variant Use this decision tree to select the appropriate variant: