Verified Commit 5ae74e4c authored by mathieui's avatar mathieui
Browse files

Do not log unhandled iq errors and timeouts in the error log

tends to happen quite often
parent f0768909
......@@ -85,11 +85,18 @@ def main():
cocore.debug = True
from slixmpp.exceptions import IqError, IqTimeout
def swallow_iqerrors(loop, context):
"""Do not log unhandled iq errors and timeouts"""
if not isinstance(context['exception'], (IqError, IqTimeout)):
# Warning: asyncio must always be imported after the config. Otherwise
# the asyncio logger will not follow our configuration and won't write
# the tracebacks in the correct file, etc
import asyncio
loop = asyncio.get_event_loop()
loop.add_reader(sys.stdin, cocore.on_input_readable)
loop.add_signal_handler(signal.SIGWINCH, cocore.sigwinch_handler)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment