From d16e3bb37bfd6433df541ae7148d97f20f177ad5 Mon Sep 17 00:00:00 2001 From: Julien Duponchelle Date: Mon, 12 Dec 2016 10:17:45 +0100 Subject: [PATCH] Catch cancelled error when you Ctrl-C during server initalisation Fix #820 --- gns3server/web/web_server.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gns3server/web/web_server.py b/gns3server/web/web_server.py index b59a4ef1..1b27d832 100644 --- a/gns3server/web/web_server.py +++ b/gns3server/web/web_server.py @@ -81,7 +81,7 @@ class WebServer: try: srv = self._loop.create_server(handler, self._host, self._port, ssl=ssl_context) self._server, startup_res = self._loop.run_until_complete(asyncio.gather(srv, self._app.startup(), loop=self._loop)) - except OSError as e: + except (OSError, asyncio.CancelledError) as e: log.critical("Could not start the server: {}".format(e)) return False return True