Files
Kisani/Core/Errors/BackupError.swift
Robin Kutesa b96711c535 Initial scaffold — NASBackup iOS app
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>
2026-05-15 17:05:04 +03:00

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"
}
}
}