Improved error handling.

This commit is contained in:
Martin Edenhofer 2014-11-25 07:51:45 +01:00
parent 697db3839f
commit 2c25123824

View file

@ -7,10 +7,10 @@ class Channel < ApplicationModel
channels = Channel.where( 'active = ? AND area LIKE ?', true, '%::Inbound' )
channels.each { |channel|
begin
c = eval 'Channel::' + channel[:adapter] + '.new'
c = eval 'Channel::' + channel[:adapter].upcase + '.new'
c.fetch(channel)
rescue Exception => e
puts "can't use " + 'Channel::' + channel[:adapter]
puts "can't use " + 'Channel::' + channel[:adapter].upcase
puts e.inspect
puts e.backtrace
c.disconnect