Files
wehub-resource-sync 869b84f27c
Build / build (push) Waiting to run
chore: import upstream snapshot with attribution
2026-07-13 12:29:30 +08:00

28 lines
1.1 KiB
Swift

import Foundation
enum ScanError: LocalizedError {
case permissionDenied(path: String)
case directoryEnumerationFailed(path: String, underlying: Error)
case processExecutionFailed(tool: String, underlying: Error)
case invalidData(context: String)
case helperToolUnavailable
case operationCancelled
var errorDescription: String? {
switch self {
case .permissionDenied(let path):
return "Permission denied when accessing '\(path)'. Grant Full Disk Access in System Settings."
case .directoryEnumerationFailed(let path, let underlying):
return "Failed to enumerate directory '\(path)': \(underlying.localizedDescription)"
case .processExecutionFailed(let tool, let underlying):
return "Failed to execute '\(tool)': \(underlying.localizedDescription)"
case .invalidData(let context):
return "Invalid data encountered: \(context)"
case .helperToolUnavailable:
return "The privileged helper tool is not installed or unavailable."
case .operationCancelled:
return "The operation was cancelled."
}
}
}