aboutsummaryrefslogtreecommitdiff
path: root/pkg/api/handlers/compat/containers_stop.go
diff options
context:
space:
mode:
Diffstat (limited to 'pkg/api/handlers/compat/containers_stop.go')
-rw-r--r--pkg/api/handlers/compat/containers_stop.go7
1 files changed, 4 insertions, 3 deletions
diff --git a/pkg/api/handlers/compat/containers_stop.go b/pkg/api/handlers/compat/containers_stop.go
index 1c1fb310c..33bb3a679 100644
--- a/pkg/api/handlers/compat/containers_stop.go
+++ b/pkg/api/handlers/compat/containers_stop.go
@@ -1,6 +1,8 @@
package compat
import (
+ "errors"
+ "fmt"
"net/http"
"github.com/containers/podman/v4/libpod"
@@ -10,7 +12,6 @@ import (
"github.com/containers/podman/v4/pkg/domain/entities"
"github.com/containers/podman/v4/pkg/domain/infra/abi"
"github.com/gorilla/schema"
- "github.com/pkg/errors"
)
func StopContainer(w http.ResponseWriter, r *http.Request) {
@@ -29,7 +30,7 @@ func StopContainer(w http.ResponseWriter, r *http.Request) {
// override any golang type defaults
}
if err := decoder.Decode(&query, r.URL.Query()); err != nil {
- utils.Error(w, http.StatusBadRequest, errors.Wrapf(err, "failed to parse parameters for %s", r.URL.String()))
+ utils.Error(w, http.StatusBadRequest, fmt.Errorf("failed to parse parameters for %s: %w", r.URL.String(), err))
return
}
@@ -63,7 +64,7 @@ func StopContainer(w http.ResponseWriter, r *http.Request) {
}
report, err := containerEngine.ContainerStop(r.Context(), []string{name}, options)
if err != nil {
- if errors.Cause(err) == define.ErrNoSuchCtr {
+ if errors.Is(err, define.ErrNoSuchCtr) {
utils.ContainerNotFound(w, name, err)
return
}