Added try to throwing expressions in example.
Both `Template(named: "template.stencil")` and `Template(named: "template.stencil")` throw but were not preceded by `try`. This usage example, in it's current form, triggers compiler errors.
This commit is contained in:
@@ -25,8 +25,8 @@ let context = Context(dictionary: [
|
|||||||
])
|
])
|
||||||
|
|
||||||
do {
|
do {
|
||||||
let template = Template(named: "template.stencil")
|
let template = try Template(named: "template.stencil")
|
||||||
let rendered = template.render(context)
|
let rendered = try template.render(context)
|
||||||
print(rendered)
|
print(rendered)
|
||||||
} catch {
|
} catch {
|
||||||
print("Failed to render template \(error)")
|
print("Failed to render template \(error)")
|
||||||
|
|||||||
Reference in New Issue
Block a user