refactor(loader): Throw when template not found

This commit is contained in:
Kyle Fuller
2016-11-30 17:07:38 +00:00
parent 63c2b935f7
commit 2ebb79df8b
8 changed files with 156 additions and 10 deletions

View File

@@ -67,9 +67,7 @@ class ExtendsNode : NodeType {
throw TemplateSyntaxError("'\(self.templateName)' could not be resolved as a string")
}
guard let template = try loader.loadTemplate(name: templateName) else {
throw TemplateSyntaxError("'\(templateName)' template not found")
}
let template = try loader.loadTemplate(name: templateName)
let blockContext: BlockContext
if let context = context[BlockContext.contextKey] as? BlockContext {