Permalink
Browse files

catching uberconfig load error.

  • Loading branch information...
1 parent b54b8ca commit 389938bedc92c4cb7c57027b9194569e3abea567 @treeder treeder committed Aug 6, 2012
Showing with 8 additions and 4 deletions.
  1. +8 −4 config.ru
View
@@ -4,10 +4,14 @@ require 'iron_mq'
require 'sinatra'
require 'uber_config'
-@config = UberConfig.load
-p @config
+@config = nil
+begin
+ @config = UberConfig.load
+ p @config
+rescue => ex
+ puts "Swallowed error: #{ex.message}"
+end
@config = {} unless @config
-
@config["iron"] ||= {}
@config["iron"]["token"] ||= ENV['IRON_WORKER_TOKEN']
@config["iron"]["project_id"] ||= ENV['IRON_WORKER_PROJECT_ID']
@@ -19,7 +23,7 @@ IronWorker.configure do |iwc|
iwc.project_id = @config["iron"]["project_id"]
end
-ironmq = IronMQ::Client.new('token' => @config["iron"]["token"], 'project_id' => @config["iron"]["project_id"])
+ironmq = IronMQ::Client.new('token' => @config["iron"]["token"], 'project_id' => @config["iron"]["project_id"])
#ironmq.logger.level = Logger::DEBUG
set :ironmq, ironmq

0 comments on commit 389938b

Please sign in to comment.