Class: IEX::Cloud::Response::RaiseError

Inherits:
Faraday::Response::RaiseError
  • Object
show all
Defined in:
lib/iex/cloud/response.rb

Instance Method Summary collapse

Instance Method Details

#on_complete(env) ⇒ Object



5
6
7
8
9
10
11
12
13
14
15
16
# File 'lib/iex/cloud/response.rb', line 5

def on_complete(env)
  case env[:status]
  when 404
    raise Faraday::Error::ResourceNotFound, response_values(env)
  when 403
    raise IEX::Errors::PermissionDeniedError, response_values(env)
  when ClientErrorStatuses
    raise IEX::Errors::ClientError, response_values(env)
  else
    super
  end
end