-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathKeychainStoreError.swift
More file actions
41 lines (37 loc) · 1.09 KB
/
Copy pathKeychainStoreError.swift
File metadata and controls
41 lines (37 loc) · 1.09 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
//
// KeychainStoreError.swift
// NativeAppTemplate
//
import Foundation
/// Keychain persistence errors
/// Error codes: NATIVEAPPTEMPLATE-4001 to NATIVEAPPTEMPLATE-4004
enum KeychainStoreError: CodedError {
case secCallFailed(Error)
case notFound
case badData
case archiveFailure(Error)
nonisolated var errorCode: String {
switch self {
case .secCallFailed:
"NATIVEAPPTEMPLATE-4001"
case .notFound:
"NATIVEAPPTEMPLATE-4002"
case .badData:
"NATIVEAPPTEMPLATE-4003"
case .archiveFailure:
"NATIVEAPPTEMPLATE-4004"
}
}
nonisolated var errorDescription: String? {
switch self {
case let .secCallFailed(error):
"KeychainStoreError::SecCallFailed[Error: \(error.localizedDescription)]"
case .notFound:
"KeychainStoreError::NotFound"
case .badData:
"KeychainStoreError::BadData"
case let .archiveFailure(error):
"KeychainStoreError::ArchiveFailure[Error: \(error.localizedDescription)]"
}
}
}