Method: Chef::ShellOut#error!

Defined in:
lib/chef/shell_out.rb

#error!Object

Checks the exitstatus against the set of valid_exit_codes. If exitstatus is not in the list of valid_exit_codes, calls invalid!, which raises an Exception.

Returns

nil:

always returns nil when it does not raise

Raises

Chef::Exceptions::ShellCommandFailed:

via invalid!



191
192
193
194
195
# File 'lib/chef/shell_out.rb', line 191

def error!
  unless Array(valid_exit_codes).include?(exitstatus)
    invalid!("Expected process to exit with #{valid_exit_codes.inspect}, but received '#{exitstatus}'")
  end
end