class Ruby::Pomodoro::Cmd::ErrorHandler

Public Instance Methods

call(error) click to toggle source
# File lib/ruby/pomodoro/cmd/error_handler.rb, line 5
def call(error)
  path = File.join(Dir.home, ".ruby-pomodoro", "log")
  Logger.new(path).error(error.message)
  print text: "Oops! Error! Detail info in the log file (~/.ruby-pomodoro/log)\n", color: :red
  prompt.keypress(
    "Press any key to continue, resumes automatically in 3 seconds ...", timeout: 3
  )
  Main.new.call
end