class Hbtrack::ErrorHandler
Public Class Methods
raise_error_msg(msg)
click to toggle source
# File lib/hbtrack/error_handler.rb, line 6 def raise_error_msg(msg) Util.red msg end
raise_habit_name_too_long()
click to toggle source
# File lib/hbtrack/error_handler.rb, line 23 def raise_habit_name_too_long raise_error_msg 'habit_name too long.' end
raise_habit_not_found(habit_name)
click to toggle source
# File lib/hbtrack/error_handler.rb, line 15 def raise_habit_not_found(habit_name) raise_error_msg "Invalid habit: #{habit_name} not found." end
raise_if_habit_error(habit_name)
click to toggle source
# File lib/hbtrack/error_handler.rb, line 10 def raise_if_habit_error(habit_name) return raise_invalid_arguments if habit_name.nil? raise_habit_not_found(habit_name) end
raise_invalid_arguments()
click to toggle source
# File lib/hbtrack/error_handler.rb, line 19 def raise_invalid_arguments raise_error_msg 'Invalid argument: habit_name is expected.' end