Exception: Twilio::REST::RestError
- Inherits:
-
TwilioError
- Object
- StandardError
- TwilioError
- Twilio::REST::RestError
- Defined in:
- lib/twilio-ruby/framework/rest/error.rb
Instance Attribute Summary collapse
-
#code ⇒ Object
readonly
Returns the value of attribute code.
-
#details ⇒ Object
readonly
Returns the value of attribute details.
-
#error_message ⇒ Object
readonly
Returns the value of attribute error_message.
-
#message ⇒ Object
readonly
Returns the value of attribute message.
-
#more_info ⇒ Object
readonly
Returns the value of attribute more_info.
-
#response ⇒ Object
readonly
Returns the value of attribute response.
-
#status_code ⇒ Object
readonly
Returns the value of attribute status_code.
Instance Method Summary collapse
-
#initialize(message, response) ⇒ RestError
constructor
A new instance of RestError.
- #to_s ⇒ Object
Constructor Details
#initialize(message, response) ⇒ RestError
Returns a new instance of RestError.
11 12 13 14 15 16 17 18 19 |
# File 'lib/twilio-ruby/framework/rest/error.rb', line 11 def initialize(, response) @status_code = response.status_code @code = response.body.fetch('code', @status_code) @details = response.body.fetch('details', nil) @error_message = response.body.fetch('message', nil) @more_info = response.body.fetch('more_info', nil) @message = () @response = response end |
Instance Attribute Details
#code ⇒ Object (readonly)
Returns the value of attribute code.
9 10 11 |
# File 'lib/twilio-ruby/framework/rest/error.rb', line 9 def code @code end |
#details ⇒ Object (readonly)
Returns the value of attribute details.
9 10 11 |
# File 'lib/twilio-ruby/framework/rest/error.rb', line 9 def details @details end |
#error_message ⇒ Object (readonly)
Returns the value of attribute error_message.
9 10 11 |
# File 'lib/twilio-ruby/framework/rest/error.rb', line 9 def @error_message end |
#message ⇒ Object (readonly)
Returns the value of attribute message.
9 10 11 |
# File 'lib/twilio-ruby/framework/rest/error.rb', line 9 def @message end |
#more_info ⇒ Object (readonly)
Returns the value of attribute more_info.
9 10 11 |
# File 'lib/twilio-ruby/framework/rest/error.rb', line 9 def more_info @more_info end |
#response ⇒ Object (readonly)
Returns the value of attribute response.
9 10 11 |
# File 'lib/twilio-ruby/framework/rest/error.rb', line 9 def response @response end |
#status_code ⇒ Object (readonly)
Returns the value of attribute status_code.
9 10 11 |
# File 'lib/twilio-ruby/framework/rest/error.rb', line 9 def status_code @status_code end |
Instance Method Details
#to_s ⇒ Object
21 22 23 |
# File 'lib/twilio-ruby/framework/rest/error.rb', line 21 def to_s end |