| import Foundation | |
| /// Errors surfaced by WtpsplitKit. | |
| public enum KitError: Error, CustomStringConvertible { | |
| /// A bundled resource (vocabulary / remap table) is missing or malformed. | |
| case corruptResource(String) | |
| /// A bundled resource could not be located in the package bundle. | |
| case missingResource(String) | |
| /// The Core ML model does not have the expected inputs/outputs/shape. | |
| case modelIncompatible(String) | |
| public var description: String { | |
| switch self { | |
| case .corruptResource(let m): return "WtpsplitKit: corrupt resource — \(m)" | |
| case .missingResource(let m): return "WtpsplitKit: missing resource — \(m)" | |
| case .modelIncompatible(let m): return "WtpsplitKit: incompatible model — \(m)" | |
| } | |
| } | |
| } | |