Catch specific errors; avoid suppressing CancelledError

This commit is contained in:
Neil Booth 2018-10-16 15:03:17 +01:00
parent d9d802f970
commit 9a37c40d07

View File

@ -155,7 +155,7 @@ class SessionManager(object):
host, port = args[:2]
try:
self.servers[kind] = await server
except Exception as e:
except OSError as e: # don't suppress CancelledError
self.logger.error(f'{kind} server failed to listen on {host}:'
f'{port:d} :{e!r}')
else: