Skip to content

Commit 4dbce5f

Browse files
authored
[Docs] Remove obsolete example about catching ConfigError (#7)
### Motivation Fixes #6. Because `ConfigError` isn't actually a public type, remove an example that showed how to catch and inspect it. ### Modifications Removed the example. ### Result Corrected docs. ### Test Plan N/A
1 parent e6f5e4f commit 4dbce5f

File tree

1 file changed

+0
-19
lines changed

1 file changed

+0
-19
lines changed

Sources/Configuration/Documentation.docc/Guides/Choosing-reader-methods.md

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -169,25 +169,6 @@ Use required variants when:
169169
- **Critical functionality**: Configuration that must be present for core features to work.
170170
- **Fail-fast behavior**: You want immediate errors for missing critical configuration.
171171

172-
#### Error types
173-
174-
Required variants throw specific errors for different failure scenarios:
175-
176-
```swift
177-
do {
178-
let port = try config.requiredInt(forKey: "server.port")
179-
} catch ConfigError.missingRequiredConfigValue(let key) {
180-
// The configuration key wasn't found in any provider
181-
print("Missing required config: \(key)")
182-
} catch ConfigError.configValueNotConvertible(let name, let type) {
183-
// The value exists but can't be converted to the expected type
184-
print("Config '\(name)' can't convert to \(type)")
185-
} catch {
186-
// Provider-specific errors (network issues, file not found, etc.)
187-
print("Provider error: \(error)")
188-
}
189-
```
190-
191172
### Choosing the right variant
192173

193174
Use this decision tree to select the appropriate variant:

0 commit comments

Comments
 (0)