Class: Tartarus::Rack

Inherits:
Object
  • Object
show all
Defined in:
lib/tartarus/rack.rb

Instance Method Summary collapse

Constructor Details

#initialize(app, configuration = {}) ⇒ Rack

Returns a new instance of Rack.



2
3
4
5
# File 'lib/tartarus/rack.rb', line 2

def initialize(app, configuration = {})
  @app = app 
  @configuration = configuration
end

Instance Method Details

#call(env) ⇒ Object



7
8
9
10
11
12
13
14
15
16
17
18
19
20
# File 'lib/tartarus/rack.rb', line 7

def call(env)
  begin
    response = @app.call(env)
  rescue Exception => exception
    Tartarus.log(env, exception)
    raise
  end

  if env['rack.exception']
    Tartarus.log(env, exception) 
  end

  response
end