Class: Smartsheet::API::FaradayErrorResponse
- Inherits:
-
FaradayResponse
- Object
- FaradayResponse
- Smartsheet::API::FaradayErrorResponse
- Defined in:
- lib/smartsheet/api/faraday_adapter/faraday_response.rb
Overview
Provides a Smartsheet error response from a Faraday response environment
Constant Summary collapse
- RETRYABLE_ERRORS =
4001..4004
Instance Attribute Summary collapse
-
#detail ⇒ Object
readonly
Returns the value of attribute detail.
-
#error_code ⇒ Object
readonly
Returns the value of attribute error_code.
-
#message ⇒ Object
readonly
Returns the value of attribute message.
-
#ref_id ⇒ Object
readonly
Returns the value of attribute ref_id.
Attributes inherited from FaradayResponse
#headers, #reason_phrase, #status_code
Instance Method Summary collapse
-
#initialize(result, faraday_env) ⇒ FaradayErrorResponse
constructor
A new instance of FaradayErrorResponse.
- #should_retry? ⇒ Boolean
- #success? ⇒ Boolean
Methods inherited from FaradayResponse
Constructor Details
#initialize(result, faraday_env) ⇒ FaradayErrorResponse
Returns a new instance of FaradayErrorResponse.
35 36 37 38 39 40 41 |
# File 'lib/smartsheet/api/faraday_adapter/faraday_response.rb', line 35 def initialize(result, faraday_env) super(faraday_env) @error_code = result[:errorCode] @message = result[:message] @ref_id = result[:refId] @detail = result[:detail] end |
Instance Attribute Details
#detail ⇒ Object (readonly)
Returns the value of attribute detail.
33 34 35 |
# File 'lib/smartsheet/api/faraday_adapter/faraday_response.rb', line 33 def detail @detail end |
#error_code ⇒ Object (readonly)
Returns the value of attribute error_code.
33 34 35 |
# File 'lib/smartsheet/api/faraday_adapter/faraday_response.rb', line 33 def error_code @error_code end |
#message ⇒ Object (readonly)
Returns the value of attribute message.
33 34 35 |
# File 'lib/smartsheet/api/faraday_adapter/faraday_response.rb', line 33 def @message end |
#ref_id ⇒ Object (readonly)
Returns the value of attribute ref_id.
33 34 35 |
# File 'lib/smartsheet/api/faraday_adapter/faraday_response.rb', line 33 def ref_id @ref_id end |
Instance Method Details
#should_retry? ⇒ Boolean
43 44 45 |
# File 'lib/smartsheet/api/faraday_adapter/faraday_response.rb', line 43 def should_retry? RETRYABLE_ERRORS.include? error_code end |
#success? ⇒ Boolean
47 48 49 |
# File 'lib/smartsheet/api/faraday_adapter/faraday_response.rb', line 47 def success? false end |