Write all logs to disk

This commit is contained in:
Christoph Hagen
2022-12-04 23:10:44 +01:00
parent 956cfb52c4
commit a8b328efce
7 changed files with 159 additions and 82 deletions

View File

@ -22,8 +22,13 @@ extension Template {
}
init(from url: URL, results: GenerationResultsHandler) throws {
let raw = try String(contentsOf: url)
self.init(raw: raw, results: results)
do {
let raw = try String(contentsOf: url)
self.init(raw: raw, results: results)
} catch {
results.warning("Failed to load: \(error)", source: "Template \(url.lastPathComponent)")
throw error
}
}
@discardableResult