Closed kapacuk closed 10 years ago
The relevant code:
def connect(self):
"""\
Connect to the IRC server using the nickname
"""
self._sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
try:
self._sock.connect((self.server, self.port))
except socket.error:
self.logger.error('Unable to connect to %s on port %d' % (self.server, self.port), exc_info=1)
sys.exit(1)
self._sock_file = self._sock.makefile()
self.register_nick()
self.register()
I think it would be much better just to return True or False and let the caller decide what to do if the connection was unsuccessful - retry a bit later, try another server, or indeed exit.