diff --git a/lib/jabber/bot.rb b/lib/jabber/bot.rb index 93c9805..01e9993 100644 --- a/lib/jabber/bot.rb +++ b/lib/jabber/bot.rb @@ -378,8 +378,14 @@ def parse_command(sender, message) #:nodoc: params = match.captures # Pass an array, params = params.pop if params.count < 2 # a string, or nil. - response = command[:callback].call(sender, params) - deliver(sender, response) unless response.nil? + begin + response = command[:callback].call(sender, params) + deliver(sender, response) unless response.nil? + rescue Exception + p $! + puts *$@ + deliver(sender, "ERROR: #{$!}") + end return end