class Faraday::Response::RaiseDatmachineError

Constants

HTTP_STATUS_CODES

Public Instance Methods

on_complete(response) click to toggle source
# File lib/datmachine/response/datmachine_exception_middleware.rb, line 26
def on_complete(response)
  status_code = response[:status].to_i
  error_class = CATEGORY_CODE_MAP[category_code] || HTTP_STATUS_CODES[status_code]
  raise error_class.new(response) if error_class
end