mirror of
https://github.com/GNS3/gns3-server.git
synced 2025-01-30 13:03:46 +02:00
Allow users to see an error when the server cannot stream a PCAP file.
This commit is contained in:
parent
3a1ba8f42d
commit
3e3e1df051
@ -300,9 +300,12 @@ class Link:
|
|||||||
try:
|
try:
|
||||||
stream_content = yield from self.read_pcap_from_source()
|
stream_content = yield from self.read_pcap_from_source()
|
||||||
except aiohttp.web.HTTPException as e:
|
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._capturing = False
|
||||||
|
self._project.notification.emit("log.error", {"message": error_msg})
|
||||||
self._project.controller.notification.emit("link.updated", self.__json__())
|
self._project.controller.notification.emit("link.updated", self.__json__())
|
||||||
|
|
||||||
with stream_content as stream:
|
with stream_content as stream:
|
||||||
with open(self.capture_file_path, "wb+") as f:
|
with open(self.capture_file_path, "wb+") as f:
|
||||||
while self._capturing:
|
while self._capturing:
|
||||||
|
Loading…
Reference in New Issue
Block a user