Class: RestCore::ErrorDetector
- Inherits:
-
Object
- Object
- RestCore::ErrorDetector
- Includes:
- Middleware
- Defined in:
- lib/rest-core/middleware/error_detector.rb
Direct Known Subclasses
Constant Summary
Constants included from Middleware
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
Class Method Summary collapse
Instance Method Summary collapse
Methods included from Middleware
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
Class Method Details
.members ⇒ Object
5 |
# File 'lib/rest-core/middleware/error_detector.rb', line 5 def self.members; [:error_detector]; end |
Instance Method Details
#call(env) ⇒ Object
8 9 10 11 12 13 |
# File 'lib/rest-core/middleware/error_detector.rb', line 8 def call env app.call(env){ |response| detector = error_detector(env) yield(fail(response, detector && detector.call(response))) } end |