Exception: Fantasydata::Error::ClientError

Inherits:
Fantasydata::Error show all
Defined in:
lib/fantasydata/error/client_error.rb

Overview

Raised when Fantasydata returns a 4xx HTTP status code or there’s an error in Faraday

Constant Summary

Constants inherited from Fantasydata::Error

EnhanceYourCalm, RateLimited

Instance Attribute Summary

Attributes inherited from Fantasydata::Error

#wrapped_exception

Class Method Summary collapse

Methods inherited from Fantasydata::Error

#backtrace, descendants, errors, #initialize

Constructor Details

This class inherits a constructor from Fantasydata::Error

Class Method Details

.from_response(response = {}) ⇒ Echowrap::Error

Create a new error from an HTTP environment

Parameters:

  • response (Hash) (defaults to: {})

Returns:

  • (Echowrap::Error)


12
13
14
# File 'lib/fantasydata/error/client_error.rb', line 12

def self.from_response(response={})
  new(parse_error(response[:body]), response[:response_headers])
end