Exception: Gupshup::REST::RestError
- Inherits:
-
GupshupError
- Object
- StandardError
- GupshupError
- Gupshup::REST::RestError
- Defined in:
- lib/gupshup_whatsapp/framework/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
-
#body ⇒ Object
deprecated
Deprecated.
use #response instead
-
#initialize(message) ⇒ RestError
constructor
A new instance of RestError.
- #to_s ⇒ Object
Constructor Details
#initialize(message) ⇒ RestError
16 17 18 19 20 21 22 23 24 25 |
# File 'lib/gupshup_whatsapp/framework/error.rb', line 16 def initialize() super @status_code = response.status_code @code = response.body.fetch('code', @status_code) @details = response.body.fetch('details', nil) = response.body.fetch('message', nil) @more_info = response.body.fetch('more_info', nil) @response = response end |
Instance Attribute Details
#code ⇒ Object (readonly)
Returns the value of attribute code.
15 16 17 |
# File 'lib/gupshup_whatsapp/framework/error.rb', line 15 def code @code end |
#details ⇒ Object (readonly)
Returns the value of attribute details.
15 16 17 |
# File 'lib/gupshup_whatsapp/framework/error.rb', line 15 def details @details end |
#error_message ⇒ Object (readonly)
Returns the value of attribute error_message.
15 16 17 |
# File 'lib/gupshup_whatsapp/framework/error.rb', line 15 def end |
#message ⇒ Object (readonly)
Returns the value of attribute message.
15 16 17 |
# File 'lib/gupshup_whatsapp/framework/error.rb', line 15 def end |
#more_info ⇒ Object (readonly)
Returns the value of attribute more_info.
15 16 17 |
# File 'lib/gupshup_whatsapp/framework/error.rb', line 15 def more_info @more_info end |
#response ⇒ Object (readonly)
Returns the value of attribute response.
15 16 17 |
# File 'lib/gupshup_whatsapp/framework/error.rb', line 15 def response @response end |
#status_code ⇒ Object (readonly)
Returns the value of attribute status_code.
15 16 17 |
# File 'lib/gupshup_whatsapp/framework/error.rb', line 15 def status_code @status_code end |
Instance Method Details
#body ⇒ Object
Deprecated.
use #response instead
28 29 30 31 32 |
# File 'lib/gupshup_whatsapp/framework/error.rb', line 28 def body warn 'This error used to be a "Twilio::REST::TwilioError" but is now a "Twilio::REST::RestError". ' \ 'Please use #response instead of #body.' @response end |
#to_s ⇒ Object
34 35 36 |
# File 'lib/gupshup_whatsapp/framework/error.rb', line 34 def to_s end |