Some checks failed
gitea-openium/resgen.swift/pipeline/head There was a failure building this commit
32 lines
1.1 KiB
Swift
32 lines
1.1 KiB
Swift
//
|
|
// FontToolError.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)
|
|
case writeExtension(String, String)
|
|
|
|
var localizedDescription: String {
|
|
switch self {
|
|
case .fcScan(let path, let code, let output):
|
|
return "error:[\(FontTool.toolName)] 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.toolName)] Input folder not found: \(inputFolder)"
|
|
|
|
case .fileNotExists(let filename):
|
|
return " error:[\(FontTool.toolName)] File \(filename) does not exists"
|
|
|
|
case .writeExtension(let filename, let info):
|
|
return "error:[\(FontTool.toolName)] An error occured while writing extension in \(filename): \(info)"
|
|
}
|
|
}
|
|
}
|