minor code refactoring

This commit is contained in:
Ilya Puchka
2017-12-27 19:29:17 +01:00
parent 662849e968
commit d6766b43da
5 changed files with 58 additions and 60 deletions

View File

@@ -15,12 +15,7 @@ public func renderNodes(_ nodes:[NodeType], _ context:Context) throws -> String
do {
return try $0.render(context)
} catch {
if var error = error as? TemplateSyntaxError {
error.token = error.token ?? $0.token
throw error
} else {
throw error
}
throw error.withToken($0.token)
}
}).joined(separator: "")
}