diff options
author | dmitry kim <jason@nichego.net> | 2008-03-12 02:26:47 +0300 |
---|---|---|
committer | dmitry kim <jason@nichego.net> | 2008-03-12 02:26:47 +0300 |
commit | 157c81d67d2252ab1650d7acf5c3daf067d4356a (patch) | |
tree | 9c7f518168983e255998af8c7aaa2616a808b1f9 | |
parent | c67eb4071b38377ef32a7b6cc07cd6111f754870 (diff) |
* (messagemapper) catch and report all exceptions in threaded actions
-rw-r--r-- | lib/rbot/messagemapper.rb | 9 |
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 |