diff --git a/src/client.js b/src/client.js index ef03d1503..0ea23f149 100644 --- a/src/client.js +++ b/src/client.js @@ -256,7 +256,18 @@ export function pullImage(system, reference) { reference: reference, }; podmanCall("libpod/images/pull", "POST", options, system) - .then(reply => resolve(JSON.parse(reply))) + .then(r => { + // Need to check the last response if it contains error + const responses = r.trim().split("\n"); + const response = JSON.parse(responses[responses.length - 1]); + if (response.error) { + response.message = response.error; + reject(response); + } else if (response.cause) // present for 400 and 500 errors + reject(response); + else + resolve(); + }) .catch(reject); }); } diff --git a/test/check-application b/test/check-application index f094082b6..80b16f6c8 100755 --- a/test/check-application +++ b/test/check-application @@ -676,6 +676,9 @@ class TestApplication(testlib.MachineCase): b.wait_visible('#containers-images td[data-label="Name"]:contains("{0}")'.format(self.imageName)) checkImage(b, "localhost:5000/{0}:{1}".format(self.imageName, self.imageTag or "latest"), "system" if self.user == "system" else "admin") + # Confirm that no error has happened + b.wait_not_present('h4.pf-c-alert__title:contains("Failed to download image")') + # Find out this image ID self.imageSha = execute(self.user == "system", "podman inspect --format '{{{{.Id}}}}' localhost:5000/{0}:{1}".format(self.imageName, self.imageTag or "latest")).strip()