Sha256: 377800cdc5cdb44e39e9c40205453c0d552dc9ad33718174f21ff44491defd17

Contents?: true

Size: 473 Bytes

Versions: 2

Compression:

Stored size: 473 Bytes

Contents

module Errplane
  class Rack
    def initialize(app)
      @app = app
    end

    def call(env)
      dup._call(env)
    end

    def _call(env)
      begin
        status, headers, body = @app.call(env)
      rescue => e
        Errplane.transmit_unless_ignorable(e, env)
        raise(e)
      ensure
        _body = []
        body.each { |line| _body << line }
        body.close if body.respond_to?(:close)
      end

      [status, headers, _body]
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
errplane-0.6.8 lib/errplane/rack.rb
errplane-0.6.7 lib/errplane/rack.rb