1
0
mirror of https://github.com/GNS3/gns3-server synced 2024-12-25 00:08:11 +00:00

Catch error when we can't access to a unix socket

This commit is contained in:
Julien Duponchelle 2017-02-06 17:59:00 +01:00
parent 94fd4bcbe9
commit 19b70accd5
No known key found for this signature in database
GPG Key ID: CE8B29639E07F5E8

View File

@ -122,7 +122,10 @@ def _asyncio_open_serial_unix(path):
raise NodeError('Pipe file "{}" is missing'.format(path)) raise NodeError('Pipe file "{}" is missing'.format(path))
output = SerialReaderWriterProtocol() output = SerialReaderWriterProtocol()
con = yield from asyncio.get_event_loop().create_unix_connection(lambda: output, path) try:
yield from asyncio.get_event_loop().create_unix_connection(lambda: output, path)
except ConnectionRefusedError:
raise NodeError('Can\'t open pipe file "{}"'.format(path))
return output return output