- 
                Notifications
    
You must be signed in to change notification settings  - Fork 14
 
Closed
Description
The following example is not possible due to ConfigError being declared with the package access level.
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)")
}Metadata
Metadata
Assignees
Labels
No labels