Method: Puppet::Util::Errors#fail
- Defined in:
- lib/puppet/util/errors.rb
#fail(message, ..) ⇒ Object #fail(error_klass, message, ..) ⇒ Object #fail(error_klass, message, ..) ⇒ Object
Throw an error, defaulting to a Puppet::Error.
149 150 151 152 153 154 155 156 157 158 159 160 |
# File 'lib/puppet/util/errors.rb', line 149 def fail(*args) if args[0].is_a?(Class) type = args.shift else type = Puppet::Error end other = args.count > 1 ? args.pop : nil error = adderrorcontext(type.new(args.join(" ")), other) raise error end |