From: Alexandre Terrasa Date: Thu, 21 May 2015 18:11:04 +0000 (-0400) Subject: nitiwiki display error before crashing when a template got missing X-Git-Tag: v0.7.5~30^2~2 X-Git-Url: http://nitlanguage.org nitiwiki display error before crashing when a template got missing Signed-off-by: Alexandre Terrasa --- diff --git a/contrib/nitiwiki/src/wiki_base.nit b/contrib/nitiwiki/src/wiki_base.nit index 81dc157..b250071 100644 --- a/contrib/nitiwiki/src/wiki_base.nit +++ b/contrib/nitiwiki/src/wiki_base.nit @@ -188,7 +188,10 @@ class Nitiwiki # # REQUIRE: `has_template` fun load_template(name: String): TemplateString do - assert has_template(name) + if not has_template(name) then + message("Error: can't load template `{name}`", 0) + exit 1 + end var file = expand_path(config.root_dir, config.templates_dir, name) var tpl = new TemplateString.from_file(file) if tpl.has_macro("ROOT_URL") then