lib/lita/handler/event_router.rb in lita-4.5.0 vs lib/lita/handler/event_router.rb in lita-4.6.0
- old
+ new
@@ -55,10 +55,14 @@
# @param event_name [String, Symbol], The name of the event to trigger.
# @param payload [Hash] An optional hash of arbitrary data.
# @return [Boolean] Whether or not the event triggered any callbacks.
def trigger(robot, event_name, payload = {})
event_subscriptions_for(event_name).map do |callback|
- callback.call(new(robot), payload)
+ begin
+ callback.call(new(robot), payload)
+ rescue => error
+ log_error(robot, error)
+ end
end.any?
end
private