Exception: ResoTransport::RequestError
- Inherits:
-
ResourceError
- Object
- StandardError
- ResourceError
- ResoTransport::RequestError
- Defined in:
- lib/reso_transport/errors.rb
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.
Attributes inherited from ResourceError
Instance Method Summary collapse
-
#initialize(request, response, resource = nil) ⇒ RequestError
constructor
A new instance of RequestError.
- #message ⇒ Object
Methods inherited from ResourceError
Constructor Details
#initialize(request, response, resource = nil) ⇒ RequestError
Returns a new instance of RequestError.
41 42 43 44 45 |
# File 'lib/reso_transport/errors.rb', line 41 def initialize(request, response, resource = nil) @response = response.respond_to?(:to_hash) ? response.to_hash : response @request = request super resource end |
Instance Attribute Details
#request ⇒ Object (readonly)
Returns the value of attribute request.
39 40 41 |
# File 'lib/reso_transport/errors.rb', line 39 def request @request end |
#response ⇒ Object (readonly)
Returns the value of attribute response.
39 40 41 |
# File 'lib/reso_transport/errors.rb', line 39 def response @response end |
Instance Method Details
#message ⇒ Object
47 48 49 |
# File 'lib/reso_transport/errors.rb', line 47 def "Received #{response[:status]} for #{resource_name}" end |