diff options
Diffstat (limited to 'lib/puppet/network/http/webrick.rb')
-rw-r--r-- | lib/puppet/network/http/webrick.rb | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/puppet/network/http/webrick.rb b/lib/puppet/network/http/webrick.rb index 85a329454..c22bce938 100644 --- a/lib/puppet/network/http/webrick.rb +++ b/lib/puppet/network/http/webrick.rb @@ -7,8 +7,11 @@ class Puppet::Network::HTTP::WEBrick < WEBrick::HTTPServer end def listen(args = {}) - raise ArgumentError if args.keys.empty? + raise ArgumentError, ":handlers must be specified." if !args[:handlers] or args[:handlers].keys.empty? + raise ArgumentError, ":address must be specified." unless args[:address] + raise ArgumentError, ":port must be specified." unless args[:port] raise "WEBrick server is already listening" if listening? + # TODO / FIXME: this should be moved out of the wacky Puppet global namespace! Puppet.start @listening = true |