Sha256: 70d802bd0be5a7c4932ac9df679f2378529ca359aec220182317665937ab5414

Contents?: true

Size: 301 Bytes

Versions: 23

Compression:

Stored size: 301 Bytes

Contents

require 'rest-core/middleware'

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

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

Version data entries

23 entries across 23 versions & 1 rubygems

Version Path
rest-core-3.6.0 lib/rest-core/middleware/error_detector.rb
rest-core-3.5.92 lib/rest-core/middleware/error_detector.rb
rest-core-3.5.91 lib/rest-core/middleware/error_detector.rb
rest-core-3.5.9 lib/rest-core/middleware/error_detector.rb
rest-core-3.5.8 lib/rest-core/middleware/error_detector.rb
rest-core-3.5.7 lib/rest-core/middleware/error_detector.rb
rest-core-3.5.6 lib/rest-core/middleware/error_detector.rb
rest-core-3.5.5 lib/rest-core/middleware/error_detector.rb
rest-core-3.5.4 lib/rest-core/middleware/error_detector.rb
rest-core-3.5.3 lib/rest-core/middleware/error_detector.rb
rest-core-3.5.2 lib/rest-core/middleware/error_detector.rb
rest-core-3.5.1 lib/rest-core/middleware/error_detector.rb
rest-core-3.5.0 lib/rest-core/middleware/error_detector.rb
rest-core-3.4.1 lib/rest-core/middleware/error_detector.rb
rest-core-3.4.0 lib/rest-core/middleware/error_detector.rb
rest-core-3.3.3 lib/rest-core/middleware/error_detector.rb
rest-core-3.3.2 lib/rest-core/middleware/error_detector.rb
rest-core-3.3.1 lib/rest-core/middleware/error_detector.rb
rest-core-3.3.0 lib/rest-core/middleware/error_detector.rb
rest-core-3.2.0 lib/rest-core/middleware/error_detector.rb