Class: LinkedIn::RaiseError

Inherits:
Faraday::Response::RaiseError
  • Object
show all
Defined in:
lib/linked_in/raise_error.rb

Instance Method Summary collapse

Instance Method Details

#on_complete(response) ⇒ Object



5
6
7
8
9
10
11
12
# File 'lib/linked_in/raise_error.rb', line 5

def on_complete(response)
  status_code = response.status.to_i
  if status_code == 403 && response.body =~ /throttle/i
    raise LinkedIn::ThrottleError
  else
    super
  end
end