summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--pkg/api/handlers/utils/errors.go6
1 files changed, 4 insertions, 2 deletions
diff --git a/pkg/api/handlers/utils/errors.go b/pkg/api/handlers/utils/errors.go
index 919a8df1e..bf60b2c84 100644
--- a/pkg/api/handlers/utils/errors.go
+++ b/pkg/api/handlers/utils/errors.go
@@ -40,10 +40,12 @@ func VolumeNotFound(w http.ResponseWriter, name string, err error) {
}
func ContainerNotFound(w http.ResponseWriter, name string, err error) {
- if errors.Cause(err) != define.ErrNoSuchCtr {
+ switch errors.Cause(err) {
+ case define.ErrNoSuchCtr, define.ErrCtrExists:
+ Error(w, http.StatusNotFound, err)
+ default:
InternalServerError(w, err)
}
- Error(w, http.StatusNotFound, err)
}
func ImageNotFound(w http.ResponseWriter, name string, err error) {