X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=lib%2Frbot%2Fmessagemapper.rb;h=87bdd01f6e7150b2630848ce98cc6bca0eec111a;hb=9996da20c88d45c34b8f1267b23b83ae1e1bbea3;hp=8b52baa4a04392ee4c5d8ab78070b644e46ee39f;hpb=6f5528a63b44e610a3d25d7fe583399163d7d2da;p=user%2Fhenk%2Fcode%2Fruby%2Frbot.git diff --git a/lib/rbot/messagemapper.rb b/lib/rbot/messagemapper.rb index 8b52baa4..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 @@ -413,6 +420,7 @@ class Bot end pre = nil if extra.sub!(/^!/, "") post = nil if extra.sub!(/!$/, "") + extra = nil if extra.empty? else extra = nil end