String: @re: catch “invalid group reference” exceptions. (Fixes second issue of GH-824.)

This commit is contained in:
Valentin Lorentz 2014-08-25 09:43:02 +00:00
parent 3cd9bb7896
commit 838c3e5a66

View File

@ -28,6 +28,7 @@
# POSSIBILITY OF SUCH DAMAGE.
###
import re
import sys
import types
import codecs
@ -205,6 +206,8 @@ class String(callbacks.Plugin):
irc.reply(v)
except commands.ProcessTimeoutError as e:
irc.error("ProcessTimeoutError: %s" % (e,))
except re.error as e:
irc.error(e.args[0])
re = thread(wrap(re, [first('regexpMatcher', 'regexpReplacer'),
'text']))