Refactor + Bugs fixes on Strings + Gestion de la génération des images
This commit is contained in:
27
Sources/FontTool/FontToolError.swift
Normal file
27
Sources/FontTool/FontToolError.swift
Normal file
@@ -0,0 +1,27 @@
|
||||
//
|
||||
// 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)
|
||||
|
||||
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"
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user