Using string repr of error when address is in use

This commit is contained in:
PhilipTrauner 2016-04-09 00:15:14 +02:00
parent 7f881f3bf7
commit 8033e044fb

View file

@ -15,8 +15,8 @@ class Server:
self.sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
try:
self.sock.bind(host_port_pair)
except OSError:
Logging.error("Port currently in use. Exiting...")
except OSError as e:
Logging.error(str(e))
exit(1)
self.sock.listen(2)
self.handlers = []