Sha256: 91f0079bb3d9ba5d230ecbb75fd3b63d8f4be3141057631350f116eea3281ab1

Contents?: true

Size: 302 Bytes

Versions: 17

Compression:

Stored size: 302 Bytes

Contents

require 'rest-core/middleware'

class RestCore::ErrorDetector
  def self.members; [:error_detector]; end
  include RestCore::Middleware

  def call env
    response = app.call(env)
    if error = error_detector(env).call(response)
      fail(response, error)
    else
      response
    end
  end
end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
rest-core-0.8.1 lib/rest-core/middleware/error_detector.rb
rest-core-0.8.0 lib/rest-core/middleware/error_detector.rb
rest-core-0.7.2 lib/rest-core/middleware/error_detector.rb
rest-core-0.7.0 lib/rest-core/middleware/error_detector.rb
rest-core-0.4.0 lib/rest-core/middleware/error_detector.rb
rest-core-0.4.0.pre.2 lib/rest-core/middleware/error_detector.rb
rest-core-0.4.0.pre.1 lib/rest-core/middleware/error_detector.rb
rest-core-0.4.0.pre.0 lib/rest-core/middleware/error_detector.rb
rest-core-0.3.0 lib/rest-core/middleware/error_detector.rb
rest-core-0.3.0.pre.2 lib/rest-core/middleware/error_detector.rb
rest-core-0.3.0.pre.1 lib/rest-core/middleware/error_detector.rb
rest-core-0.3.0.pre.0 lib/rest-core/middleware/error_detector.rb
rest-core-0.2.3 lib/rest-core/middleware/error_detector.rb
rest-core-0.2.2 lib/rest-core/middleware/error_detector.rb
rest-core-0.2.1 lib/rest-core/middleware/error_detector.rb
rest-core-0.2.0 lib/rest-core/middleware/error_detector.rb
rest-core-0.0.1 lib/rest-core/middleware/error_detector.rb