Exception: SignalWire::REST::SignalWireRestError
- Inherits:
-
StandardError
- Object
- StandardError
- SignalWire::REST::SignalWireRestError
- Defined in:
- lib/signalwire/rest/http_client.rb
Overview
Raised when the SignalWire REST API returns a non-2xx response.
Instance Attribute Summary collapse
-
#body ⇒ Object
readonly
Returns the value of attribute body.
-
#method_name ⇒ Object
readonly
Returns the value of attribute method_name.
-
#status_code ⇒ Object
readonly
Returns the value of attribute status_code.
-
#url ⇒ Object
readonly
Returns the value of attribute url.
Instance Method Summary collapse
-
#initialize(status_code, body, url, method_name = 'GET') ⇒ SignalWireRestError
constructor
A new instance of SignalWireRestError.
Constructor Details
#initialize(status_code, body, url, method_name = 'GET') ⇒ SignalWireRestError
Returns a new instance of SignalWireRestError.
14 15 16 17 18 19 20 |
# File 'lib/signalwire/rest/http_client.rb', line 14 def initialize(status_code, body, url, method_name = 'GET') @status_code = status_code @body = body @url = url @method_name = method_name super("#{method_name} #{url} returned #{status_code}: #{body}") end |
Instance Attribute Details
#body ⇒ Object (readonly)
Returns the value of attribute body.
12 13 14 |
# File 'lib/signalwire/rest/http_client.rb', line 12 def body @body end |
#method_name ⇒ Object (readonly)
Returns the value of attribute method_name.
12 13 14 |
# File 'lib/signalwire/rest/http_client.rb', line 12 def method_name @method_name end |
#status_code ⇒ Object (readonly)
Returns the value of attribute status_code.
12 13 14 |
# File 'lib/signalwire/rest/http_client.rb', line 12 def status_code @status_code end |
#url ⇒ Object (readonly)
Returns the value of attribute url.
12 13 14 |
# File 'lib/signalwire/rest/http_client.rb', line 12 def url @url end |