From 3e3e1df051f126d90d38ca3d186a5366d7f6bc86 Mon Sep 17 00:00:00 2001 From: grossmj Date: Thu, 7 Dec 2017 12:28:01 -0600 Subject: [PATCH] Allow users to see an error when the server cannot stream a PCAP file. --- gns3server/controller/link.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/gns3server/controller/link.py b/gns3server/controller/link.py index 62fbe2a9..0c9d5bc4 100644 --- a/gns3server/controller/link.py +++ b/gns3server/controller/link.py @@ -300,9 +300,12 @@ class Link: try: stream_content = yield from self.read_pcap_from_source() except aiohttp.web.HTTPException as e: - log.error("Could not stream pcap file: error {}: {}".format(e.status, e.text)) + error_msg = "Could not stream PCAP file: error {}: {}".format(e.status, e.text) + log.error(error_msg) self._capturing = False + self._project.notification.emit("log.error", {"message": error_msg}) self._project.controller.notification.emit("link.updated", self.__json__()) + with stream_content as stream: with open(self.capture_file_path, "wb+") as f: while self._capturing: