def call_main
      @leak_exceptions = nil unless defined? @leak_exceptions
      @main_block.call(*ARGV)
    rescue Methadone::Error => ex
      raise ex if ENV['DEBUG']
      logger.error ex.message unless no_message? ex
      ex.exit_code
    rescue OptionParser::ParseError
      raise
    rescue => ex
      raise ex if ENV['DEBUG']
      raise ex if @leak_exceptions
      logger.error ex.message unless no_message? ex
      70 # Linux sysexit code for internal software error
    end
def call_main
      @leak_exceptions = nil unless defined? @leak_exceptions
      @main_block.call(*ARGV)
    rescue Methadone::Error => ex
      raise ex if ENV['DEBUG']
      logger.error ex.message unless no_message? ex
      ex.exit_code
    rescue OptionParser::ParseError
      raise
    rescue => ex
      raise ex if ENV['DEBUG']
      raise ex if @leak_exceptions
      logger.error ex.message unless no_message? ex
      70 # Linux sysexit code for internal software error
    end
Handle calling main and trapping any exceptions thrown