Class: RestCore::ErrorDetectorHttp

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

Constant Summary

Constant Summary

Constants included from Middleware

Middleware::UNRESERVED

Constants included from RestCore

ASYNC, CLIENT, DRY, FAIL, HIJACK, LOG, PROMISE, REQUEST_HEADERS, REQUEST_METHOD, REQUEST_PATH, REQUEST_PAYLOAD, REQUEST_QUERY, REQUEST_URI, RESPONSE_BODY, RESPONSE_HEADERS, RESPONSE_KEY, RESPONSE_SOCKET, RESPONSE_STATUS, TIMER, Universal, VERSION

Instance Method Summary (collapse)

Methods inherited from ErrorDetector

#call, members

Methods included from Middleware

#call, contain_binary?, escape, #fail, #id, included, #log, merge_hash, percent_encode, request_uri, #run, string_keys

Methods included from RestCore

eagerload, id

Constructor Details

- (ErrorDetectorHttp) initialize(app, detector = nil)

Returns a new instance of ErrorDetectorHttp



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

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