Don't log files that dont load throw error instead
remove swift-log dependency
This commit is contained in:
@@ -18,9 +18,9 @@ public final class HBMustacheLibrary {
|
||||
/// the folder is recursive and templates in subfolders will be registered with the name `subfolder/template`.
|
||||
/// - Parameter directory: Directory to look for mustache templates
|
||||
/// - Parameter extension: Extension of files to look for
|
||||
public init(directory: String, withExtension extension: String = "mustache", logger: Logger? = nil) {
|
||||
public init(directory: String, withExtension extension: String = "mustache") throws {
|
||||
templates = [:]
|
||||
loadTemplates(from: directory, withExtension: `extension`, logger: logger)
|
||||
try loadTemplates(from: directory, withExtension: `extension`)
|
||||
}
|
||||
|
||||
/// Register template under name
|
||||
@@ -49,5 +49,9 @@ public final class HBMustacheLibrary {
|
||||
return template.render(object)
|
||||
}
|
||||
|
||||
public enum Error: Swift.Error {
|
||||
case failedToLoad(String, Swift.Error)
|
||||
}
|
||||
|
||||
private var templates: [String: HBMustacheTemplate]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user