mirror of
https://github.com/Mikaela/Limnoria.git
synced 2025-01-11 20:52:42 +01:00
Make our error message for the Plugin.__init__ changes better and try to prevent spurious, invalid error messages.
This commit is contained in:
parent
527a6e1834
commit
181c623703
@ -73,15 +73,16 @@ def loadPluginClass(irc, module, register=None):
|
|||||||
try:
|
try:
|
||||||
cb = module.Class(irc)
|
cb = module.Class(irc)
|
||||||
except TypeError, e:
|
except TypeError, e:
|
||||||
if '2 given' in str(e):
|
s = str(e)
|
||||||
|
if '2 given' in s and '__init__' in s:
|
||||||
raise callbacks.Error, \
|
raise callbacks.Error, \
|
||||||
'In our switch from CVS to Darcs (after 0.80.1), we ' \
|
'In our switch from CVS to Darcs (after 0.80.1), we ' \
|
||||||
'changed the __init__ for callbacks.Privmsg* to also ' \
|
'changed the __init__ for callbacks.Privmsg* to also ' \
|
||||||
'accept an irc argument. This plugin is overriding ' \
|
'accept an irc argument. This plugin (%s) is overriding ' \
|
||||||
'its __init__ method and needs to update its prototype ' \
|
'its __init__ method and needs to update its prototype ' \
|
||||||
'to be \'def __init__(self, irc):\' as well as passing ' \
|
'to be \'def __init__(self, irc):\' as well as passing ' \
|
||||||
'that irc object on to any calls to the plugin\'s ' \
|
'that irc object on to any calls to the plugin\'s ' \
|
||||||
'parent\'s __init__.'
|
'parent\'s __init__.' % module.__name__
|
||||||
else:
|
else:
|
||||||
raise
|
raise
|
||||||
except AttributeError, e:
|
except AttributeError, e:
|
||||||
|
Loading…
Reference in New Issue
Block a user