User: Handle DuplicateHostmask exception in hostmask.add.

Signed-off-by: James Vega <jamessan@users.sourceforge.net>
This commit is contained in:
James Vega 2010-08-29 11:24:54 -04:00
parent de726f90f3
commit 577294f489

View File

@ -327,6 +327,8 @@ class User(callbacks.Plugin):
ircdb.users.setUser(user)
except ValueError, e:
irc.error(str(e), Raise=True)
except ircdb.DuplicateHostmask:
irc.error('That hostmask is already registered.', Raise=True)
irc.replySuccess()
add = wrap(add, ['private', first('otherUser', 'user'),
optional('something'), additional('something', '')])