From 19b70accd553244ab9403fe53a18f5b954a7688d Mon Sep 17 00:00:00 2001 From: Julien Duponchelle Date: Mon, 6 Feb 2017 17:59:00 +0100 Subject: [PATCH] Catch error when we can't access to a unix socket --- gns3server/utils/asyncio/serial.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/gns3server/utils/asyncio/serial.py b/gns3server/utils/asyncio/serial.py index 6dc961dd..48d12bc0 100644 --- a/gns3server/utils/asyncio/serial.py +++ b/gns3server/utils/asyncio/serial.py @@ -122,7 +122,10 @@ def _asyncio_open_serial_unix(path): raise NodeError('Pipe file "{}" is missing'.format(path)) 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