summaryrefslogtreecommitdiff
path: root/pkg/api
diff options
context:
space:
mode:
authorMatej Vasek <mvasek@redhat.com>2021-11-28 19:02:15 +0100
committerMatthew Heon <mheon@redhat.com>2021-12-06 15:27:55 -0500
commit741d98fadea94d4042922cb6edabb468f11a4eb3 (patch)
tree69fe668615cf503e09f6b637faf4d0692af2a74d /pkg/api
parent905eabf0bef95d5202483464779680f01a3cc1a1 (diff)
downloadpodman-741d98fadea94d4042922cb6edabb468f11a4eb3.tar.gz
podman-741d98fadea94d4042922cb6edabb468f11a4eb3.tar.bz2
podman-741d98fadea94d4042922cb6edabb468f11a4eb3.zip
fix: error reporting for archive endpoint
Returning 500 when copying to read-only destination. Signed-off-by: Matej Vasek <mvasek@redhat.com>
Diffstat (limited to 'pkg/api')
-rw-r--r--pkg/api/handlers/compat/containers_archive.go4
1 files changed, 3 insertions, 1 deletions
diff --git a/pkg/api/handlers/compat/containers_archive.go b/pkg/api/handlers/compat/containers_archive.go
index cda23a399..54cbe01e9 100644
--- a/pkg/api/handlers/compat/containers_archive.go
+++ b/pkg/api/handlers/compat/containers_archive.go
@@ -133,8 +133,10 @@ func handlePut(w http.ResponseWriter, r *http.Request, decoder *schema.Decoder,
return
}
- w.WriteHeader(http.StatusOK)
if err := copyFunc(); err != nil {
logrus.Error(err.Error())
+ utils.Error(w, "Something went wrong.", http.StatusInternalServerError, err)
+ return
}
+ w.WriteHeader(http.StatusOK)
}