From 4b0c45d8956b56e5cbc16470c9e1e7318dac8145 Mon Sep 17 00:00:00 2001
From: Jonne Hass <mrzyx@mrzyx.de>
Date: Mon, 12 Sep 2011 01:05:49 +0200
Subject: [PATCH] rescue unmeaningful exception from settingslogic if the
 namespace doesn't exists and replace it with meaningful error message

---
 app/models/app_config.rb | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/app/models/app_config.rb b/app/models/app_config.rb
index 11a4ef9b3a..8d2514ef32 100644
--- a/app/models/app_config.rb
+++ b/app/models/app_config.rb
@@ -42,7 +42,13 @@ HELP
       Process.exit(1)
     end
 
-    super
+    begin
+      super
+    rescue TypeError
+      puts "Couldn't find section ''#{self.namespace}' in config/application.yml."
+      puts "Double check it's there and that you haven't set RAILS_ENV to something weired (check it for typos)"
+      Process.exit(1)
+    end
 
     if no_cert_file_in_prod?
       $stderr.puts <<-HELP
-- 
GitLab