lib/modern_times/manager.rb in modern_times-0.2.2 vs lib/modern_times/manager.rb in modern_times-0.2.3
- old
+ new
@@ -22,17 +22,17 @@
ModernTimes.logger.info "Starting #{worker_klass} with #{num_workers} workers with options #{worker_options.inspect}"
unless worker_klass.kind_of?(Class)
begin
worker_klass = Object.const_get(worker_klass.to_s)
rescue
- raise ModernTimes::Exception, "Invalid class: #{worker_klass}"
+ raise "Invalid class: #{worker_klass}"
end
end
if @allowed_workers && !@allowed_workers.include?(worker_klass)
- raise ModernTimes::Exception, "Error: #{worker_klass.name} is not an allowed worker"
+ raise "Error: #{worker_klass.name} is not an allowed worker"
end
supervisor = worker_klass.create_supervisor(self, worker_options)
- raise ModernTimes::Exception "A supervisor with name #{supervisor.name} already exists" if find_supervisor(supervisor.name)
+ raise "A supervisor with name #{supervisor.name} already exists" if find_supervisor(supervisor.name)
mbean = supervisor.create_mbean(@domain)
@supervisors << supervisor
supervisor.worker_count = num_workers
@jmx_server.register_mbean(mbean, "#{@domain}:worker=#{supervisor.name},type=Worker")
ModernTimes.logger.info "Started #{worker_klass.name} named #{supervisor.name} with #{num_workers} workers"