Files
vphone-cli/sources/FirmwarePatcher/Core/PatcherError.swift
Lakr 08eb9d260f 🐦 iBSS iBEC LLB TXM
update

update
2026-03-11 04:22:50 +08:00

30 lines
978 B
Swift

// PatcherError.swift Error types for firmware patching.
import Foundation
public enum PatcherError: Error, CustomStringConvertible, Sendable {
case fileNotFound(String)
case invalidFormat(String)
case patchSiteNotFound(String)
case patchVerificationFailed(String)
case encodingFailed(String)
case multipleMatchesFound(String, count: Int)
public var description: String {
switch self {
case let .fileNotFound(path):
"File not found: \(path)"
case let .invalidFormat(msg):
"Invalid format: \(msg)"
case let .patchSiteNotFound(msg):
"Patch site not found: \(msg)"
case let .patchVerificationFailed(msg):
"Patch verification failed: \(msg)"
case let .encodingFailed(msg):
"Instruction encoding failed: \(msg)"
case let .multipleMatchesFound(msg, count):
"Expected 1 match for \(msg), found \(count)"
}
}
}