summaryrefslogtreecommitdiffstats
path: root/lib/puppet/parser/functions/fail.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/puppet/parser/functions/fail.rb')
-rw-r--r--lib/puppet/parser/functions/fail.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/puppet/parser/functions/fail.rb b/lib/puppet/parser/functions/fail.rb
new file mode 100644
index 000000000..35b20ee92
--- /dev/null
+++ b/lib/puppet/parser/functions/fail.rb
@@ -0,0 +1,4 @@
+Puppet::Parser::Functions::newfunction(:fail, :doc => "Fail with a parse error.") do |vals|
+ vals = vals.collect { |s| s.to_s }.join(" ") if vals.is_a? Array
+ raise Puppet::ParseError, vals.to_s
+end