Class: RestCore::ErrorDetector

Inherits:
Object
  • Object
show all
Includes:
Middleware
Defined in:
lib/rest-core/middleware/error_detector.rb

Direct Known Subclasses

ErrorDetectorHttp

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.membersObject



4
# File 'lib/rest-core/middleware/error_detector.rb', line 4

def self.members; [:error_detector]; end

Instance Method Details

#call(env) ⇒ Object



7
8
9
10
11
12
# File 'lib/rest-core/middleware/error_detector.rb', line 7

def call env
  app.call(env){ |response|
    detector = error_detector(env)
    yield(fail(response, detector && detector.call(response)))
  }
end