lib/ig_markets/cli/main.rb
# Prints the passed error to `stderr` and then exits the application.
Prints the passed error to `stderr` and then exits the application.
Prints the passed error to ` stderr ` and then exits the application .
def warn_and_exit(error)
          class_name = error.class.name.split('::').last
          class_name = nil if class_name == 'IGMarketsError'
          message = error.message.to_s
          message = nil if ['', error.class.to_s].include? message
          warn "ig_markets: #{[class_name, message].compact.join ', '}"
          exit 1
        end
def warn_and_exit ( error ) class_name = error . class . name . split ( '::' ) . last class_name = nil if class_name == 'IGMarketsError' message = error . message . to_s message = nil if [ '' , error . class . to_s ] . include? message warn "ig_markets: #{[class_name, message].compact.join ', '}" exit 1 end
Prints the passed error to `stderr` and then exits the application.
Prints the passed error to ` stderr ` and then exits the application .
error