From cbda62d1be5c13ac96b9fef10bc2eceead909727 Mon Sep 17 00:00:00 2001 From: Matej Vasek Date: Sun, 28 Nov 2021 19:02:15 +0100 Subject: fix: error reporting for archive endpoint Returning 500 when copying to read-only destination. Signed-off-by: Matej Vasek --- pkg/api/handlers/compat/containers_archive.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'pkg') 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) } -- cgit v1.2.3-54-g00ecf