summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authordmitry kim <jason@nichego.net>2008-03-12 02:26:47 +0300
committerdmitry kim <jason@nichego.net>2008-03-12 02:26:47 +0300
commit157c81d67d2252ab1650d7acf5c3daf067d4356a (patch)
tree9c7f518168983e255998af8c7aaa2616a808b1f9 /lib
parentc67eb4071b38377ef32a7b6cc07cd6111f754870 (diff)
* (messagemapper) catch and report all exceptions in threaded actions
Diffstat (limited to 'lib')
-rw-r--r--lib/rbot/messagemapper.rb9
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/rbot/messagemapper.rb b/lib/rbot/messagemapper.rb
index 62543f32..87bdd01f 100644
--- a/lib/rbot/messagemapper.rb
+++ b/lib/rbot/messagemapper.rb
@@ -193,7 +193,14 @@ class Bot
if m.bot.auth.allow?(auth, m.source, m.replyto)
debug "template match found and auth'd: #{action.inspect} #{options.inspect}"
if tmpl.options[:thread] || tmpl.options[:threaded]
- Thread.new { @parent.send(action, m, options) }
+ Thread.new do
+ begin
+ @parent.send(action, m, options)
+ rescue Exception => e
+ error "In threaded action: #{e.message}"
+ debug e.backtrace.join("\n")
+ end
+ end
else
@parent.send(action, m, options)
end