Exception: Fanforce::API::DecodingError
- Defined in:
- lib/fanforce/api/error.rb
Instance Attribute Summary
Attributes inherited from Error
#errors, #request, #requested_params, #requested_url, #response
Instance Method Summary collapse
- #code ⇒ Object
-
#initialize(e, response, request, requested_url, requested_params) ⇒ DecodingError
constructor
A new instance of DecodingError.
- #to_hash ⇒ Object
Methods inherited from Error
Constructor Details
#initialize(e, response, request, requested_url, requested_params) ⇒ DecodingError
Returns a new instance of DecodingError.
55 56 57 58 59 |
# File 'lib/fanforce/api/error.rb', line 55 def initialize(e, response, request, requested_url, requested_params) = "There was a Fanforce gem error while decoding JSON response: #{e.is_a?(String) ? e : e.message}" @errors = [{message: }] super(, response, request, requested_url, requested_params) end |
Instance Method Details
#code ⇒ Object
65 |
# File 'lib/fanforce/api/error.rb', line 65 def code; 500 end |
#to_hash ⇒ Object
61 62 63 |
# File 'lib/fanforce/api/error.rb', line 61 def to_hash {errors: @errors} end |