Exception: Twilio::REST::TwilioError

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

Direct Known Subclasses

RestError

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(message, body = nil) ⇒ TwilioError

Returns a new instance of TwilioError.



6
7
8
9
# File 'lib/twilio-ruby/framework/error.rb', line 6

def initialize(message, body = nil)
  @message = message
  @body = body
end

Instance Attribute Details

#bodyObject (readonly)

Returns the value of attribute body.



4
5
6
# File 'lib/twilio-ruby/framework/error.rb', line 4

def body
  @body
end

#messageObject (readonly)

Returns the value of attribute message.



4
5
6
# File 'lib/twilio-ruby/framework/error.rb', line 4

def message
  @message
end

Instance Method Details

#to_sObject



11
12
13
# File 'lib/twilio-ruby/framework/error.rb', line 11

def to_s
  "#{@message}: #{@body || 'no body'}"
end