Class: Arrow::FallbackHandler

Inherits:
Object
  • Object
show all
Defined in:
lib/arrow/fallbackhandler.rb

Overview

The Arrow::FallbackHandler class, a request handler for Arrow that is used to handle misconfigured handler requests.

VCS Id

$Id$

Authors

  • Michael Granger

Please see the file LICENSE in the top-level directory for licensing details.

Instance Method Summary

Constructor Details

- (FallbackHandler) initialize(key, instances)

Create a new instance for the given key and instances.



22
23
24
25
# File 'lib/arrow/fallbackhandler.rb', line 22

def initialize( key, instances )
  @key = key
  @instances = instances
end

Instance Method Details

- (Object) handler(req)

Handle a request with output that explains what the problem is.



29
30
31
32
33
34
35
# File 'lib/arrow/fallbackhandler.rb', line 29

def handler( req )
  req.content_type = "text/plain"
  req.send_http_header
  req.print "\nArrow Configuration Error\n\nThis URL is configured to be handled by the dispatcher keyed with '\#{@key.inspect}',\nbut there was no dispatcher associated with that key. The instances I know about\nare:\n\n\#{@instances.collect {|k,d| \"-- \#{k.inspect} --\\n\\n\#{d.inspect}\"}.join(\"\\n\\n\")}\n\n"

  return Apache::OK
end