Class: Audiosearch::FaradayErrHandler

Inherits:
Faraday::Response::Middleware
  • Object
show all
Defined in:
lib/audiosearch.rb

Instance Method Summary collapse

Instance Method Details

#on_complete(env) ⇒ Object



23
24
25
26
27
28
29
30
31
32
33
34
35
# File 'lib/audiosearch.rb', line 23

def on_complete(env)
  # Ignore any non-error response codes
  return if (status = env[:status]) < 400
  #puts "got response status #{status}"
  case status
  when 404
    #raise Error::NotFound
    # 404 errors not fatal
  else
    #puts pp(env)
    super  # let parent class deal with it
  end
end