resgen.swift/Sources/FontToolCore/FontToolError.swift

29 lines
820 B
Swift

//
// File.swift
//
//
// Created by Thibaut Schmitt on 13/12/2021.
//
import Foundation
enum FontToolError: Error {
case fcScan(String, Int32, String?)
case inputFolderNotFound(String)
case fileNotExists(String)
var localizedDescription: String {
switch self {
case .fcScan(let path, let code, let output):
return "error:[FontTool] Error while getting fontName (fc-scan --format %{postscriptname} \(path). fc-scan exit with \(code) and output is: \(output ?? "no output")"
case .inputFolderNotFound(let inputFolder):
return " error:[FontTool] Input folder not found: \(inputFolder)"
case .fileNotExists(let filename):
return " error:[FontTool] File \(filename) does not exists "
}
}
}