Class: TheTvDB::Response::RaiseError

Inherits:
Faraday::Response::Middleware
  • Object
show all
Defined in:
lib/the_tv_db/response/raise_error.rb

Instance Method Summary collapse

Instance Method Details

#on_complete(env) ⇒ Object



4
5
6
7
# File 'lib/the_tv_db/response/raise_error.rb', line 4

def on_complete(env)
  status_code = env[:status].to_i
  raise TheTvDB::RecordNotFound.new(env) if (400...600).include? status_code
end