diff --git a/gns3server/controller/project.py b/gns3server/controller/project.py index ece3d328..7d2ef53d 100644 --- a/gns3server/controller/project.py +++ b/gns3server/controller/project.py @@ -931,7 +931,7 @@ class Project: yield from wait_run_in_executor(self._create_duplicate_project_file, project_path, zipstream) with open(project_path, "rb") as f: project = yield from import_project(self._controller, str(uuid.uuid4()), f, location=location, name=name, keep_compute_id=True) - except (OSError, UnicodeEncodeError) as e: + except (ValueError, OSError, UnicodeEncodeError) as e: raise aiohttp.web.HTTPConflict(text="Can not duplicate project: {}".format(str(e))) if previous_status == "closed": diff --git a/gns3server/controller/udp_link.py b/gns3server/controller/udp_link.py index 479d66b5..018ed450 100644 --- a/gns3server/controller/udp_link.py +++ b/gns3server/controller/udp_link.py @@ -54,7 +54,7 @@ class UDPLink(Link): try: (node1_host, node2_host) = yield from node1.compute.get_ip_on_same_subnet(node2.compute) except ValueError as e: - raise aiohttp.web.HTTPConflict(text=str(e)) + raise aiohttp.web.HTTPConflict(text="Cannot get an IP address on same subnet: {}".format(e)) # Reserve a UDP port on both side response = yield from node1.compute.post("/projects/{}/ports/udp".format(self._project.id))