Class: RestCore::ErrorDetectorHttp

Inherits:
ErrorDetector show all
Defined in:
lib/rest-core/middleware/error_detector_http.rb

Instance Method Summary collapse

Methods inherited from ErrorDetector

#call, members

Constructor Details

#initialize(app, detector = nil) ⇒ ErrorDetectorHttp

Returns a new instance of ErrorDetectorHttp



6
7
8
9
# File 'lib/rest-core/middleware/error_detector_http.rb', line 6

def initialize app, detector=nil
  super(app, detector ||
             lambda{ |env| (env[RESPONSE_STATUS] || 200) / 100 >= 4 })
end