lib/adhearsion/call.rb in adhearsion-2.0.0.rc1 vs lib/adhearsion/call.rb in adhearsion-2.0.0.rc2
- old
+ new
@@ -6,13 +6,13 @@
##
# Encapsulates call-related data and behavior.
#
class Call
- Hangup = Class.new StandardError
+ Hangup = Class.new Adhearsion::Error
+ CommandTimeout = Class.new Adhearsion::Error
ExpiredError = Class.new Celluloid::DeadActorError
- CommandTimeout = Class.new StandardError
include Celluloid
include HasGuardedHandlers
def self.new(*args, &block)
@@ -70,10 +70,10 @@
register_handler :event, *guards, &block
end
def deliver_message(message)
logger.debug "Receiving message: #{message.inspect}"
- trigger_handler :event, message
+ catching_standard_errors { trigger_handler :event, message }
end
alias << deliver_message
def register_initial_handlers # :nodoc: