<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -34,7 +34,19 @@ module StarlingServer
     end
 
     def load_config_file(filename)
-      YAML.load(File.open(filename))['starling'].each do |key, value|
+      config = YAML.load(File.open(filename))
+
+      unless config.is_a?(Hash)
+        STDERR.puts &quot;Config file does not contain a hash: #{filename}, exiting.&quot;
+        exit(1)
+      end
+
+      if config['starling'].nil?
+        STDERR.puts &quot;Missing starling section in config file: #{filename}, exiting.&quot;
+        exit(1)
+      end
+
+      config['starling'].each do |key, value|
         # alias some keys
         case key
         when &quot;queue_path&quot; then key = &quot;path&quot;</diff>
      <filename>lib/starling/server_runner.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>7fef96db63b925b80f6cf939536ac0d29305f427</id>
    </parent>
  </parents>
  <author>
    <name>Jacob Atzen</name>
    <email>jacob@jacobatzen.dk</email>
  </author>
  <url>http://github.com/defunkt/starling/commit/68aa68ae3db76efdcc45661148c0440724686fff</url>
  <id>68aa68ae3db76efdcc45661148c0440724686fff</id>
  <committed-date>2008-10-17T02:05:33-07:00</committed-date>
  <authored-date>2008-10-17T02:00:41-07:00</authored-date>
  <message>If config file invalid print a nice message and exit

If the config file doesn't contain a starling section or is not a hash
exit with an error message indicating the problem instead of simply
putting a backtrace in the users face.</message>
  <tree>688f80ef5688c3c392f6500d9aacac7fcb443224</tree>
  <committer>
    <name>Jacob Atzen</name>
    <email>jacob@jacobatzen.dk</email>
  </committer>
</commit>
