Class: Ruby::Pomodoro::Cmd::ErrorHandler

Inherits:
Base
  • Object
show all
Defined in:
lib/ruby/pomodoro/cmd/error_handler.rb

Instance Method Summary collapse

Methods inherited from Base

#initialize

Methods included from TimeHelpers

#to_format_string

Constructor Details

This class inherits a constructor from Ruby::Pomodoro::Cmd::Base

Instance Method Details

#call(error) ⇒ Object



5
6
7
8
9
10
11
12
13
# 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