scripts/base_script.rb
# Called when the script is run.
# This in turn calls the inheriting class' run method.
#
# @return [exit status]
Called when the script is run.
This in turn calls the inheriting class' run method.
Called when the script is run . This in turn calls the inheriting class ' run method .
def exec 
    res = run
    if debug_mode
      puts '---'
      puts "Run response: #{res.inspect}"
      puts res.message if res.success && res.message
    end
    exit if res.success
    abort "Failed: #{res.message}"
  rescue StandardError => e
    puts "Exception: #{e.message}\n#{e.backtrace.join("\n")}" if debug_mode
    ErrorMailer.send_exception_email(e, subject: "Script #{self.class} failed", message: "Script args: #{args.inspect}\n")
    abort "Failed: #{e.message}\n#{e.backtrace.join("\n")}"
  end
def exec res = run if debug_mode puts '---' puts "Run response: #{res.inspect}" puts res . message if res . success && res . message end exit if res . success abort "Failed: #{res.message}" rescue StandardError => e puts "Exception: #{e.message}\n#{e.backtrace.join("\n")}" if debug_mode ErrorMailer . send_exception_email ( e , subject : "Script #{self.class} failed" , message : "Script args: #{args.inspect}\n" ) abort "Failed: #{e.message}\n#{e.backtrace.join("\n")}" end
Called when the script is run.
Called when the script is run .
# rubocop:disable Metrics/AbcSize, Metrics/CyclomaticComplexity
None
exit status