Method: Deas::ShowExceptions#call!

Defined in:
lib/deas/show_exceptions.rb

#call!(env) ⇒ Object

The real Rack call interface.



24
25
26
27
28
29
30
31
32
33
34
# File 'lib/deas/show_exceptions.rb', line 24

def call!(env)
  status, headers, body = @app.call(env)
  if error = env['sinatra.error']
    error_body = Body.new(error)

    headers['Content-Length'] = error_body.size.to_s
    headers['Content-Type'] = error_body.mime_type.to_s
    body = [error_body.content]
  end
  [ status, headers, body ]
end