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:
Kathryn Baldauf
2025-07-14 14:52:12 -07:00
committed by GitHub
parent e09e932efa
commit f0d82d2032
3 changed files with 11 additions and 5 deletions
@@ -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 {