File size: 776 Bytes
357ae2c
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
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)"
        }
    }
}