class Mixlib::ShellOut

def error!

::ShellCommandFailed::: via +invalid!+
=== Raises
nil::: always returns nil when it does not raise
=== Returns
If #error? is true, calls +invalid!+, which raises an Exception.
def error!
  invalid!("Expected process to exit with #{valid_exit_codes.inspect}, but received '#{exitstatus}'") if error?
end