Class: Frenetic::ResponseError
Overview
Parent class for all specific exceptions which are raised as a result of a network response.
Direct Known Subclasses
Instance Attribute Summary collapse
-
#body ⇒ Object
readonly
Returns the value of attribute body.
-
#env ⇒ Object
readonly
Returns the value of attribute env.
-
#error ⇒ Object
readonly
Returns the value of attribute error.
-
#method ⇒ Object
readonly
Returns the value of attribute method.
-
#status ⇒ Object
readonly
Returns the value of attribute status.
-
#url ⇒ Object
readonly
Returns the value of attribute url.
Instance Method Summary collapse
-
#initialize(env) ⇒ ResponseError
constructor
A new instance of ResponseError.
- #message ⇒ Object
Constructor Details
#initialize(env) ⇒ ResponseError
Returns a new instance of ResponseError.
128 129 130 131 132 133 134 135 136 137 138 139 |
# File 'lib/frenetic/errors.rb', line 128 def initialize(env) env ||= {} if env.respond_to?(:fetch) @body = env.fetch(:body, {}) @env = env @error = @body['error'] @method = env[:method] @status = env[:status] @url = env[:url] end super() end |
Instance Attribute Details
#body ⇒ Object (readonly)
Returns the value of attribute body.
127 128 129 |
# File 'lib/frenetic/errors.rb', line 127 def body @body end |
#env ⇒ Object (readonly)
Returns the value of attribute env.
127 128 129 |
# File 'lib/frenetic/errors.rb', line 127 def env @env end |
#error ⇒ Object (readonly)
Returns the value of attribute error.
127 128 129 |
# File 'lib/frenetic/errors.rb', line 127 def error @error end |
#method ⇒ Object (readonly)
Returns the value of attribute method.
127 128 129 |
# File 'lib/frenetic/errors.rb', line 127 def method @method end |
#status ⇒ Object (readonly)
Returns the value of attribute status.
127 128 129 |
# File 'lib/frenetic/errors.rb', line 127 def status @status end |
#url ⇒ Object (readonly)
Returns the value of attribute url.
127 128 129 |
# File 'lib/frenetic/errors.rb', line 127 def url @url end |
Instance Method Details
#message ⇒ Object
141 142 143 |
# File 'lib/frenetic/errors.rb', line 141 def @error end |