class Mixlib::ShellOut

def format_for_exception

results when the command exited with an unexpected status.
showing the exact command executed. Used by +invalid!+ to show command
Creates a String showing the output of the command, including a banner
def format_for_exception
  return "Command execution failed. STDOUT/STDERR suppressed for sensitive resource" if sensitive
  msg = ""
  msg << "#{@terminate_reason}\n" if @terminate_reason
  msg << "---- Begin output of #{command} ----\n"
  msg << "STDOUT: #{stdout.strip}\n"
  msg << "STDERR: #{stderr.strip}\n"
  msg << "---- End output of #{command} ----\n"
  msg << "Ran #{command} returned #{status.exitstatus}" if status
  msg
end