Exception: Zendesk2::Error
- Inherits:
-
StandardError
- Object
- StandardError
- Zendesk2::Error
- Defined in:
- lib/zendesk2/error.rb
Instance Attribute Summary collapse
-
#response ⇒ Object
readonly
Returns the value of attribute response.
-
#wrapped_exception ⇒ Object
readonly
Returns the value of attribute wrapped_exception.
Instance Method Summary collapse
-
#initialize(wrapped_exception) ⇒ Error
constructor
A new instance of Error.
Constructor Details
#initialize(wrapped_exception) ⇒ Error
Returns a new instance of Error.
4 5 6 7 8 9 10 11 12 13 14 15 16 |
# File 'lib/zendesk2/error.rb', line 4 def initialize(wrapped_exception) @wrapped_exception = wrapped_exception @response = wrapped_exception.response = if wrapped_exception.is_a?(Faraday::Error::ParsingError) wrapped_exception. elsif wrapped_exception.is_a?(Faraday::Error::ClientError) || wrapped_exception.is_a?(Faraday::ClientError) wrapped_exception.response.inspect else wrapped_exception.instance_variable_get(:@wrapped_exception) end super() end |
Instance Attribute Details
#response ⇒ Object (readonly)
Returns the value of attribute response.
3 4 5 |
# File 'lib/zendesk2/error.rb', line 3 def response @response end |
#wrapped_exception ⇒ Object (readonly)
Returns the value of attribute wrapped_exception.
3 4 5 |
# File 'lib/zendesk2/error.rb', line 3 def wrapped_exception @wrapped_exception end |