Exception: UplandMobileCommonsRest::NetworkError
- Inherits:
-
StandardError
- Object
- StandardError
- UplandMobileCommonsRest::NetworkError
- Defined in:
- lib/upland_mobile_commons_rest/errors.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#body ⇒ Object
Returns the value of attribute body.
-
#status ⇒ Object
Returns the value of attribute status.
Instance Method Summary collapse
-
#initialize(params) ⇒ NetworkError
constructor
A new instance of NetworkError.
- #to_s ⇒ Object
Constructor Details
#initialize(params) ⇒ NetworkError
Returns a new instance of NetworkError.
7 8 9 10 11 12 13 14 15 |
# File 'lib/upland_mobile_commons_rest/errors.rb', line 7 def initialize(params) self.status = params[:status] self.body = params[:body] # Including the parentheses means we call #super with no arguments, # rather than passing params along. We do this to avoid the params being # treated as the "message" of the exception. super() end |
Instance Attribute Details
#body ⇒ Object
Returns the value of attribute body.
5 6 7 |
# File 'lib/upland_mobile_commons_rest/errors.rb', line 5 def body @body end |
#status ⇒ Object
Returns the value of attribute status.
5 6 7 |
# File 'lib/upland_mobile_commons_rest/errors.rb', line 5 def status @status end |
Instance Method Details
#to_s ⇒ Object
17 18 19 |
# File 'lib/upland_mobile_commons_rest/errors.rb', line 17 def to_s "#{super}\n status: #{status}\n body: #{body}" end |