From 9ef23ce6a81e68b4d3884763d4848634d54d7bff Mon Sep 17 00:00:00 2001 From: grossmj Date: Tue, 21 Aug 2018 17:30:34 +0700 Subject: [PATCH] Include HTTP error code when reporting an error while download appliance templates from GitHub repository. --- gns3server/controller/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gns3server/controller/__init__.py b/gns3server/controller/__init__.py index a7981cea..8164c7b3 100644 --- a/gns3server/controller/__init__.py +++ b/gns3server/controller/__init__.py @@ -78,7 +78,7 @@ class Controller: log.info("Appliance templates are already up-to-date (ETag {})".format(self._appliance_templates_etag)) return elif response.status != 200: - raise aiohttp.web.HTTPConflict(text="Could not retrieve appliance templates on GitHub") + raise aiohttp.web.HTTPConflict(text="Could not retrieve appliance templates on GitHub due to HTTP error code {}".format(response.status)) etag = response.headers.get("ETag") if etag: self._appliance_templates_etag = etag @@ -92,7 +92,7 @@ class Controller: log.info("Download appliance template file from '{}'".format(appliance["download_url"])) response = yield from session.get(appliance["download_url"]) if response.status != 200: - log.warning("Could not download '{}'".format(appliance["download_url"])) + log.warning("Could not download '{}' due to HTTP error code {}".format(appliance["download_url"], response.status)) continue try: appliance_data = yield from response.read()