Improved type safety, local auth support, and better error handling
This commit is contained in:
15
Sources/KeychainKit/Enums/KeychainError.swift
Normal file
15
Sources/KeychainKit/Enums/KeychainError.swift
Normal file
@@ -0,0 +1,15 @@
|
||||
import Foundation
|
||||
|
||||
/// Errors that can occur during Keychain operations.
|
||||
public enum KeychainError: Error {
|
||||
/// Authentication failed, e.g., due to biometric or passcode denial.
|
||||
case authenticationFailed
|
||||
/// No item found matching the query.
|
||||
case itemNotFound
|
||||
/// Unexpected or corrupted data found in Keychain item.
|
||||
case unexpectedData
|
||||
/// An unexpected OSStatus error code returned by Keychain API.
|
||||
case unexpectedCode(OSStatus)
|
||||
/// A generic unexpected error, with optional underlying error info.
|
||||
case unexpectedError(Error?)
|
||||
}
|
||||
Reference in New Issue
Block a user