Exception: RememberTheMilkAPIError

Inherits:
RuntimeError
  • Object
show all
Defined in:
lib/thartmx_lib.rb

Overview

a pretty crappy exception class, but it should be sufficient for bubbling up errors returned by the RTM API (website)

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(error, method, args_to_method) ⇒ RememberTheMilkAPIError

Returns a new instance of RememberTheMilkAPIError.



426
427
428
429
430
431
# File 'lib/thartmx_lib.rb', line 426

def initialize(error, method, args_to_method)
  @method_name = method
  @args_to_method = args_to_method
  @error_code = error[:code].to_i
  @error_message = error[:msg]
end

Instance Attribute Details

#error_codeObject (readonly)

Returns the value of attribute error_code.



424
425
426
# File 'lib/thartmx_lib.rb', line 424

def error_code
  @error_code
end

#error_messageObject (readonly)

Returns the value of attribute error_message.



424
425
426
# File 'lib/thartmx_lib.rb', line 424

def error_message
  @error_message
end

#responseObject (readonly)

Returns the value of attribute response.



424
425
426
# File 'lib/thartmx_lib.rb', line 424

def response
  @response
end

Instance Method Details

#to_sObject



433
434
435
# File 'lib/thartmx_lib.rb', line 433

def to_s
  "Calling rtm.#{@method_name}(#{@args_to_method.inspect}) produced => <#{@error_code}>: #{@error_message}"
end