From 3c290e2a82b236e77b450c00f3f2f419ae5ec437 Mon Sep 17 00:00:00 2001 From: Luis Matta Date: Wed, 13 Jun 2012 12:53:46 -0300 Subject: [PATCH] Do not swallow exceptions. --- lib/stalker.rb | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/lib/stalker.rb b/lib/stalker.rb index 55d6586..617b46c 100644 --- a/lib/stalker.rb +++ b/lib/stalker.rb @@ -17,8 +17,6 @@ def enqueue(job, args={}, opts={}) ttr = opts[:ttr] || 120 beanstalk.use job beanstalk.put [ job, args ].to_json, pri, delay, ttr - rescue Beanstalk::NotConnected => e - failed_connection(e) end def job(j, &block) @@ -55,8 +53,6 @@ def prep(jobs=nil) beanstalk.list_tubes_watched.each do |server, tubes| tubes.each { |tube| beanstalk.ignore(tube) unless jobs.include?(tube) } end - rescue Beanstalk::NotConnected => e - failed_connection(e) end def work(jobs=nil) @@ -88,10 +84,6 @@ def work_one_job job.delete log_job_end(name) - rescue Beanstalk::NotConnected => e - failed_connection(e) - rescue SystemExit - raise rescue => e log_error exception_message(e) job.bury rescue nil @@ -105,13 +97,6 @@ def work_one_job end end - def failed_connection(e) - log_error exception_message(e) - log_error "*** Failed connection to #{beanstalk_url}" - log_error "*** Check that beanstalkd is running (or set a different BEANSTALK_URL)" - exit 1 - end - def log_job_begin(name, args) args_flat = unless args.empty? '(' + args.inject([]) do |accum, (key,value)|