Full project scaffold: XcodeGen project.yml, Core models/protocols/errors, SMBService (kishikawakatsumi/SMBClient), SFTPService (Citadel 0.9.2), PhotoLibraryService, LANMonitor, BackupEngine, BackgroundTaskManager, all feature UIs (Login, Connect, Browse, Backup, History, Settings), Shared components and theme. Builds clean with zero errors. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
28 lines
1.1 KiB
Swift
28 lines
1.1 KiB
Swift
import Foundation
|
|
|
|
enum BackupError: LocalizedError {
|
|
case connectionFailed(String)
|
|
case authenticationFailed
|
|
case photoLibraryDenied
|
|
case uploadFailed(String, underlying: Error)
|
|
case directoryListFailed(String)
|
|
case directoryCreateFailed(String)
|
|
case cancelled
|
|
case timeout
|
|
case networkUnavailable
|
|
|
|
var errorDescription: String? {
|
|
switch self {
|
|
case .connectionFailed(let host): return "Could not connect to \(host)"
|
|
case .authenticationFailed: return "Authentication failed — check username and password"
|
|
case .photoLibraryDenied: return "Photos access denied — update in iOS Settings"
|
|
case .uploadFailed(let file, _): return "Failed to upload \(file)"
|
|
case .directoryListFailed(let path):return "Could not list \(path)"
|
|
case .directoryCreateFailed(let p): return "Could not create folder at \(p)"
|
|
case .cancelled: return "Backup was cancelled"
|
|
case .timeout: return "Operation timed out"
|
|
case .networkUnavailable: return "Network not available"
|
|
}
|
|
}
|
|
}
|