Sha256: 0644b597026c23acd9cc261750d34866d8df6a54c73c6e9b05c3d58f8c127226

Contents?: true

Size: 493 Bytes

Versions: 12

Compression:

Stored size: 493 Bytes

Contents

module Rack
	class UnhandledRequest
		class UnhandledRequestError < ArgumentError
      attr_reader :uri
			def initialize(uri)
        @uri = uri
				super "request for URI '#{uri}' was not handled by the server"
			end
		end

		def initialize(app)
			@app = app
		end

		def call(env)
			status, headers, body = @app.call(env)
			raise UnhandledRequestError, env['SCRIPT_NAME'] + env['PATH_INFO'] if body == [] and (status == 200 or status == 404)
			[status, headers, body]
		end
	end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
unicorn-cuba-base-1.6.0 lib/unicorn-cuba-base/rack/unhandled_request.rb
unicorn-cuba-base-1.5.0 lib/unicorn-cuba-base/rack/unhandled_request.rb
unicorn-cuba-base-1.4.1 lib/unicorn-cuba-base/rack/unhandled_request.rb
unicorn-cuba-base-1.4.0 lib/unicorn-cuba-base/rack/unhandled_request.rb
unicorn-cuba-base-1.3.0 lib/unicorn-cuba-base/rack/unhandled_request.rb
unicorn-cuba-base-1.2.2 lib/unicorn-cuba-base/rack/unhandled_request.rb
unicorn-cuba-base-1.2.1 lib/unicorn-cuba-base/rack/unhandled_request.rb
unicorn-cuba-base-1.2.0 lib/unicorn-cuba-base/rack/unhandled_request.rb
unicorn-cuba-base-1.1.2 lib/unicorn-cuba-base/rack/unhandled_request.rb
unicorn-cuba-base-1.1.1 lib/unicorn-cuba-base/rack/unhandled_request.rb
unicorn-cuba-base-1.1.0 lib/unicorn-cuba-base/rack/unhandled_request.rb
unicorn-cuba-base-1.0.0 lib/unicorn-cuba-base/rack/unhandled_request.rb