Exception: Recurly::API::ResponseError
- Defined in:
- lib/recurly/api/errors.rb
Overview
The superclass to all errors that occur when making an API request.
Direct Known Subclasses
Instance Attribute Summary collapse
-
#request ⇒ Object
readonly
Returns the value of attribute request.
-
#response ⇒ Object
readonly
Returns the value of attribute response.
Instance Method Summary collapse
- #code ⇒ Object
- #description ⇒ Object
- #details ⇒ Object
-
#initialize(request, response) ⇒ ResponseError
constructor
A new instance of ResponseError.
- #symbol ⇒ Object
- #to_s ⇒ Object
Methods inherited from Error
Constructor Details
#initialize(request, response) ⇒ ResponseError
Returns a new instance of ResponseError.
10 11 12 |
# File 'lib/recurly/api/errors.rb', line 10 def initialize request, response @request, @response = request, response end |
Instance Attribute Details
#request ⇒ Object (readonly)
Returns the value of attribute request.
7 8 9 |
# File 'lib/recurly/api/errors.rb', line 7 def request @request end |
#response ⇒ Object (readonly)
Returns the value of attribute response.
8 9 10 |
# File 'lib/recurly/api/errors.rb', line 8 def response @response end |
Instance Method Details
#code ⇒ Object
14 15 16 |
# File 'lib/recurly/api/errors.rb', line 14 def code response.code.to_i if response end |
#description ⇒ Object
33 34 35 |
# File 'lib/recurly/api/errors.rb', line 33 def description xml and xml.root and xml.text '/error/description' end |
#details ⇒ Object
37 38 39 |
# File 'lib/recurly/api/errors.rb', line 37 def details xml and xml.root and xml.text '/error/details' end |
#symbol ⇒ Object
29 30 31 |
# File 'lib/recurly/api/errors.rb', line 29 def symbol xml and xml.root and xml.text '/error/symbol' end |