Exception: RememberTheMilkAPIError
- Inherits:
-
RuntimeError
- Object
- RuntimeError
- RememberTheMilkAPIError
- 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
-
#error_code ⇒ Object
readonly
Returns the value of attribute error_code.
-
#error_message ⇒ Object
readonly
Returns the value of attribute error_message.
-
#response ⇒ Object
readonly
Returns the value of attribute response.
Instance Method Summary collapse
-
#initialize(error, method, args_to_method) ⇒ RememberTheMilkAPIError
constructor
A new instance of RememberTheMilkAPIError.
- #to_s ⇒ Object
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_code ⇒ Object (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_message ⇒ Object (readonly)
Returns the value of attribute error_message.
424 425 426 |
# File 'lib/thartmx_lib.rb', line 424 def @error_message end |
#response ⇒ Object (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_s ⇒ Object
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 |