Method: Sfn::CommandModule::Base::InstanceMethods#_debug

Defined in:
lib/sfn/command_module/base.rb

#_debug(e, *args) ⇒ Object

Write exception information if debug is enabled

Parameters:

  • e (Exception)
  • args (String)

    extra strings to output



44
45
46
47
48
49
50
51
52
53
54
55
56
57
# File 'lib/sfn/command_module/base.rb', line 44

def _debug(e, *args)
  if(config[:verbose])
    ui.fatal "Exception information: #{e.class}: #{e.message}"
    if(ENV['DEBUG'])
      puts "#{e.backtrace.join("\n")}\n"
      if(e.is_a?(Miasma::Error::ApiError))
        ui.fatal "Response body: #{e.response.body.to_s.inspect}"
      end
    end
    args.each do |string|
      ui.fatal string
    end
  end
end