templates can now `raise` exceptions.

master
Luka Vandervelden 2019-11-16 16:08:52 +01:00
parent 00dc153121
commit 8d5839724b
1 changed files with 5 additions and 4 deletions

View File

@ -116,10 +116,11 @@ class GenConfig::Context
end end
end end
#options["port"] = Crinja.function do options["raise"] = Crinja.function do
# service = (arguments.varargs[0]? || "").to_s.gsub /\//, ':' message = arguments.varargs.join "\n"
# `get-port #{service}`.chomp
#end raise Service::Exception.new "template error: #{message}"
end
# FIXME: Move this to a separate binary? # FIXME: Move this to a separate binary?
options["random_password"] = Crinja.function do options["random_password"] = Crinja.function do