Class: Foobara::CommandConnectors::Http::Rack

Inherits:
Foobara::CommandConnectors::Http show all
Defined in:
lib/foobara/command_connectors/http/rack.rb,
lib/foobara/command_connectors/http/rack/request.rb

Defined Under Namespace

Classes: Request

Instance Method Summary collapse

Instance Method Details

#call(env) ⇒ Object



5
6
7
8
9
10
11
12
13
14
15
16
17
# File 'lib/foobara/command_connectors/http/rack.rb', line 5

def call(env)
  response = run(env)
  [response.status, response.headers, [response.body]]
rescue NotFoundError, InvalidContextError => e
  [404, {}, [e.message]]
rescue => e
  # :nocov:
  env["rack.errors"].puts e.to_s
  env["rack.errors"].puts e.backtrace

  raise e
  # :nocov:
end