Exception: RememberTheMilkAPIError

Inherits:
RuntimeError
  • Object
show all
Defined in:
lib/rtmapi.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.



400
401
402
403
404
405
# File 'lib/rtmapi.rb', line 400

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.



398
399
400
# File 'lib/rtmapi.rb', line 398

def error_code
  @error_code
end

#error_messageObject (readonly)

Returns the value of attribute error_message.



398
399
400
# File 'lib/rtmapi.rb', line 398

def error_message
  @error_message
end

#responseObject (readonly)

Returns the value of attribute response.



398
399
400
# File 'lib/rtmapi.rb', line 398

def response
  @response
end

Instance Method Details

#to_sObject



407
408
409
# File 'lib/rtmapi.rb', line 407

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