Exception: Twilio::REST::RestError

Inherits:
TwilioError
  • Object
show all
Defined in:
lib/twilio-ruby/framework/error.rb

Instance Attribute Summary collapse

Attributes inherited from TwilioError

#body

Instance Method Summary collapse

Constructor Details

#initialize(message, code, status_code) ⇒ RestError

Returns a new instance of RestError.



19
20
21
22
23
# File 'lib/twilio-ruby/framework/error.rb', line 19

def initialize(message, code, status_code)
  @message = message
  @code = code
  @status_code = status_code
end

Instance Attribute Details

#codeObject (readonly)

Returns the value of attribute code.



17
18
19
# File 'lib/twilio-ruby/framework/error.rb', line 17

def code
  @code
end

#messageObject (readonly)

Returns the value of attribute message.



17
18
19
# File 'lib/twilio-ruby/framework/error.rb', line 17

def message
  @message
end

#status_codeObject (readonly)

Returns the value of attribute status_code.



17
18
19
# File 'lib/twilio-ruby/framework/error.rb', line 17

def status_code
  @status_code
end

Instance Method Details

#to_sObject



25
26
27
# File 'lib/twilio-ruby/framework/error.rb', line 25

def to_s
  "[HTTP #{status_code}] #{code} : #{message}"
end