Class: MooMoo::OpenSRSErrors

Inherits:
Faraday::Response::Middleware
  • Object
show all
Defined in:
lib/moo_moo/middleware/open_srs_errors.rb

Instance Method Summary (collapse)

Instance Method Details

- (Object) on_complete(env)



3
4
5
6
7
8
# File 'lib/moo_moo/middleware/open_srs_errors.rb', line 3

def on_complete(env)
  # Checks for invalid http status
  unless (200..299).include?(env[:status])
    raise OpenSRSException, "Bad HTTP Status: #{env[:status]}"
  end
end