mirror of
https://github.com/apple/container.git
synced 2026-09-28 09:56:11 -04:00
Handle when keychain query returns an unhandled error (#331)
Depends on https://github.com/apple/containerization/pull/210 Related to https://github.com/apple/container/issues/254 --------- Signed-off-by: Kathryn Baldauf <k_baldauf@apple.com>
This commit is contained in:
@@ -166,7 +166,13 @@ extension ImagesService {
|
||||
return try await body(authentication)
|
||||
}
|
||||
let keychain = KeychainHelper(id: Self.keychainID)
|
||||
authentication = try? keychain.lookup(domain: host)
|
||||
do {
|
||||
authentication = try keychain.lookup(domain: host)
|
||||
} catch let err as KeychainHelper.Error {
|
||||
guard case .keyNotFound = err else {
|
||||
throw ContainerizationError(.internalError, message: "Error querying keychain for \(host)", cause: err)
|
||||
}
|
||||
}
|
||||
do {
|
||||
return try await body(authentication)
|
||||
} catch let err as RegistryClient.Error {
|
||||
|
||||
Reference in New Issue
Block a user