Sha256: 824c884f2bdf043aba5200c7f039914f19ea5993ac9ff48158501fcb50a5e90b

Contents?: true

Size: 332 Bytes

Versions: 16

Compression:

Stored size: 332 Bytes

Contents

require 'securerandom'

module FakeSQS
  class CatchErrors

    def initialize(app, options = {})
      @app = app
      @response = options.fetch(:response)
    end

    def call(env)
      @app.call(env)
    rescue => error
      response = @response.new(error)
      [ response.status, {}, [ response.body ] ]
    end

  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
fake_sqs-0.4.3 lib/fake_sqs/catch_errors.rb
fake_sqs-0.4.2 lib/fake_sqs/catch_errors.rb
fake_sqs-0.4.1 lib/fake_sqs/catch_errors.rb
fake_sqs-0.4.0 lib/fake_sqs/catch_errors.rb
fake_sqs-0.3.1 lib/fake_sqs/catch_errors.rb
fake_sqs-0.3.0 lib/fake_sqs/catch_errors.rb
fake_sqs-0.2.0 lib/fake_sqs/catch_errors.rb
fake_sqs-0.1.0 lib/fake_sqs/catch_errors.rb
fake_sqs-0.0.11 lib/fake_sqs/catch_errors.rb
fake_sqs-0.0.10 lib/fake_sqs/catch_errors.rb
fake_sqs-0.0.9 lib/fake_sqs/catch_errors.rb
fake_sqs-0.0.8 lib/fake_sqs/catch_errors.rb
fake_sqs-0.0.7 lib/fake_sqs/catch_errors.rb
fake_sqs-0.0.6 lib/fake_sqs/catch_errors.rb
fake_sqs-0.0.5 lib/fake_sqs/catch_errors.rb
fake_sqs-0.0.4 lib/fake_sqs/catch_errors.rb