Skip to content

Commit

Permalink
Merge pull request #21 from eu-digital-identity-wallet/develop
Browse files Browse the repository at this point in the history
add DocumentStatus pending
  • Loading branch information
phisakel committed Sep 2, 2024
2 parents 6637d4e + 3e3900f commit 28acebc
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
3 changes: 2 additions & 1 deletion Sources/WalletStorage/Enumerations.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
5 changes: 4 additions & 1 deletion Sources/WalletStorage/KeyChainStorageService.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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))
}
Expand Down

0 comments on commit 28acebc

Please sign in to comment.