summaryrefslogtreecommitdiff
path: root/pkg
diff options
context:
space:
mode:
authorPaul Holzinger <paul.holzinger@web.de>2020-12-10 14:22:36 +0100
committerPaul Holzinger <paul.holzinger@web.de>2020-12-10 14:35:17 +0100
commit3fa61f0004b04340a697a256ff51589a4d3f7c93 (patch)
treed008c4e7ec0dee1332de5710b7f7f0dd437a29f1 /pkg
parenteaa19a1c10c8eb2e5d8a0d864c123c2f3484b01a (diff)
downloadpodman-3fa61f0004b04340a697a256ff51589a4d3f7c93.tar.gz
podman-3fa61f0004b04340a697a256ff51589a4d3f7c93.tar.bz2
podman-3fa61f0004b04340a697a256ff51589a4d3f7c93.zip
Fix panic in libpod images exists endpoint
The libpod images exists endpoint panics when called with a non existing image and therefore returns 500 as status code instead of the expected 404. A test is added to ensure it is working. Signed-off-by: Paul Holzinger <paul.holzinger@web.de>
Diffstat (limited to 'pkg')
-rw-r--r--pkg/api/handlers/libpod/images.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/pkg/api/handlers/libpod/images.go b/pkg/api/handlers/libpod/images.go
index 6145207ca..505c96126 100644
--- a/pkg/api/handlers/libpod/images.go
+++ b/pkg/api/handlers/libpod/images.go
@@ -51,7 +51,7 @@ func ImageExists(w http.ResponseWriter, r *http.Request) {
return
}
if !report.Value {
- utils.Error(w, "Something went wrong.", http.StatusNotFound, errors.Wrapf(nil, "failed to find image %s", name))
+ utils.Error(w, "Something went wrong.", http.StatusNotFound, errors.Errorf("failed to find image %s", name))
return
}
utils.WriteResponse(w, http.StatusNoContent, "")