Catch IqTimeout exception when removing a contact from the roster.

This commit is contained in:
Florent Le Coz 2012-11-05 13:54:02 +00:00
parent 828938db9e
commit bcd6976cd5

View file

@ -19,7 +19,7 @@ from roster_sorting import SORTING_METHODS, GROUP_SORTING_METHODS
from os import path as p from os import path as p
from common import safeJID from common import safeJID
from sleekxmpp import JID from sleekxmpp import JID
from sleekxmpp.exceptions import IqError from sleekxmpp.exceptions import IqError, IqTimeout
class Roster(object): class Roster(object):
@ -72,7 +72,7 @@ class Roster(object):
try: try:
self.__node[jid].send_presence(ptype='unavailable') self.__node[jid].send_presence(ptype='unavailable')
self.__node.remove(jid) self.__node.remove(jid)
except IqError: except (IqError, IqTimeout):
import traceback import traceback
log.debug('IqError when removing %s:\n%s', jid, traceback.format_exc()) log.debug('IqError when removing %s:\n%s', jid, traceback.format_exc())