Skip to content

ConfigError has package access level #6

@CallumTodd7

Description

@CallumTodd7

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

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions