Add timeout exception and general exceptions. (Thank you. mirux.)
This commit is contained in:
parent
a02cc5a7a4
commit
ff2e1835d2
1 changed files with 21 additions and 0 deletions
|
@ -16,6 +16,7 @@ FIXME
|
||||||
1) Save name of groupchat instead of jid as name
|
1) Save name of groupchat instead of jid as name
|
||||||
|
|
||||||
"""
|
"""
|
||||||
|
from asyncio import TimeoutError
|
||||||
from slixmpp.exceptions import IqError, IqTimeout, PresenceError
|
from slixmpp.exceptions import IqError, IqTimeout, PresenceError
|
||||||
from kaikout.log import Logger
|
from kaikout.log import Logger
|
||||||
|
|
||||||
|
@ -143,6 +144,11 @@ class XmppMuc:
|
||||||
logger.error(str(e))
|
logger.error(str(e))
|
||||||
logger.error(jid)
|
logger.error(jid)
|
||||||
result = 'timeout'
|
result = 'timeout'
|
||||||
|
except TimeoutError as e:
|
||||||
|
logger.error('Timeout AsyncIO')
|
||||||
|
logger.error(str(e))
|
||||||
|
logger.error(jid)
|
||||||
|
result = 'timeout'
|
||||||
except PresenceError as e:
|
except PresenceError as e:
|
||||||
logger.error('Error Presence')
|
logger.error('Error Presence')
|
||||||
logger.error(str(e))
|
logger.error(str(e))
|
||||||
|
@ -152,6 +158,11 @@ class XmppMuc:
|
||||||
result = 'ban'
|
result = 'ban'
|
||||||
else:
|
else:
|
||||||
result = 'error'
|
result = 'error'
|
||||||
|
except Exception as e:
|
||||||
|
logger.error('Unknown error')
|
||||||
|
logger.error(str(e))
|
||||||
|
logger.error(jid)
|
||||||
|
result = 'unknown'
|
||||||
return result
|
return result
|
||||||
|
|
||||||
|
|
||||||
|
@ -183,6 +194,11 @@ class XmppMuc:
|
||||||
logger.error('Could not set affiliation at room: {}'.format(room))
|
logger.error('Could not set affiliation at room: {}'.format(room))
|
||||||
logger.error(str(e))
|
logger.error(str(e))
|
||||||
logger.error(room)
|
logger.error(room)
|
||||||
|
except Exception as e:
|
||||||
|
logger.error('Unknown error')
|
||||||
|
logger.error('Could not set affiliation at room: {}'.format(room))
|
||||||
|
logger.error(str(e))
|
||||||
|
logger.error(room)
|
||||||
|
|
||||||
|
|
||||||
async def set_role(self, room, alias, role, reason=None):
|
async def set_role(self, room, alias, role, reason=None):
|
||||||
|
@ -195,3 +211,8 @@ class XmppMuc:
|
||||||
logger.error('Could not set role of alias: {}'.format(alias))
|
logger.error('Could not set role of alias: {}'.format(alias))
|
||||||
logger.error(str(e))
|
logger.error(str(e))
|
||||||
logger.error(room)
|
logger.error(room)
|
||||||
|
except Exception as e:
|
||||||
|
logger.error('Unknown error')
|
||||||
|
logger.error('Could not set role of alias: {}'.format(alias))
|
||||||
|
logger.error(str(e))
|
||||||
|
logger.error(room)
|
||||||
|
|
Loading…
Reference in a new issue