diff --git a/Sources/WalletStorage/Enumerations.swift b/Sources/WalletStorage/Enumerations.swift index 362a5cf..413f5e4 100644 --- a/Sources/WalletStorage/Enumerations.swift +++ b/Sources/WalletStorage/Enumerations.swift @@ -49,7 +49,8 @@ public enum PrivateKeyType: String { /// document status -public enum DocumentStatus: String { +public enum DocumentStatus: String, CaseIterable { case issued case deferred + case pending } diff --git a/Sources/WalletStorage/KeyChainStorageService.swift b/Sources/WalletStorage/KeyChainStorageService.swift index 50b4389..30685f9 100644 --- a/Sources/WalletStorage/KeyChainStorageService.swift +++ b/Sources/WalletStorage/KeyChainStorageService.swift @@ -146,7 +146,10 @@ public class KeyChainStorageService: DataStorageService { let query: [String: Any] = makeQuery(id: id, bForSave: true, status: docStatus, dataType: dataType) let status = SecItemDelete(query as CFDictionary) let statusMessage = SecCopyErrorMessageString(status, nil) as? String - guard status == errSecSuccess else { + if status == errSecItemNotFound, id == nil { + let msg = statusMessage ?? "No items found" + logger.warning("\(msg)") + } else if status != errSecSuccess { logger.error("Error code: \(Int(status)), description: \(statusMessage ?? "")") throw StorageError(description: statusMessage ?? "", code: Int(status)) }