Skip to content Skip to sidebar Skip to footer

Python3 Catch Errors When From Self.connect(('badhost',6667))

Looks like asyncio is the module to use. I'll leave this question up anyway, because it doesn't look like there is a way to catch specific errors with asynchat. class mysocket(asyn

Solution 1:

Try to override default handle_error method:

def handle_error(self):
    t, v, tb = sys.exc_info()
    if t == socket.error:
        # do smth with it
        print("Connect error")

Post a Comment for "Python3 Catch Errors When From Self.connect(('badhost',6667))"