Class: RestCore::ErrorDetectorHttp

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

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, Simple, TIMER, Universal, VERSION

Instance Method Summary collapse

Methods inherited from ErrorDetector

#call, members

Methods included from Middleware

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

Methods included from RestCore

eagerload, id

Constructor Details

#initialize(app, detector = nil) ⇒ ErrorDetectorHttp

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