Exception: Fanforce::API::DecodingError

Inherits:
Error
  • Object
show all
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

Methods inherited from Error

#curl_command, #to_s

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)
  @message = "There was a Fanforce gem error while decoding JSON response: #{e.is_a?(String) ? e : e.message}"
  @errors = [{message: @message}]
  super(@message, response, request, requested_url, requested_params)
end

Instance Method Details

#codeObject



65
# File 'lib/fanforce/api/error.rb', line 65

def code; 500 end

#to_hashObject



61
62
63
# File 'lib/fanforce/api/error.rb', line 61

def to_hash
  {errors: @errors}
end