summaryrefslogtreecommitdiff
path: root/pkg/api/handlers
diff options
context:
space:
mode:
authorMatthew Heon <mheon@redhat.com>2020-05-20 13:12:22 -0400
committerMatthew Heon <mheon@redhat.com>2020-05-20 13:19:01 -0400
commit07d82d111af221334f799497d0946a0af943c8bb (patch)
treea025b12841b35b4bf3ccb7cbb9b7a3924a24f04c /pkg/api/handlers
parent09f8f14b4f7d09946d3d5cfc5460ec9923f7da59 (diff)
downloadpodman-07d82d111af221334f799497d0946a0af943c8bb.tar.gz
podman-07d82d111af221334f799497d0946a0af943c8bb.tar.bz2
podman-07d82d111af221334f799497d0946a0af943c8bb.zip
Print container state when erroring that it is improper
This is a nice little convenience - lets people know why we won't let them attach to a container. Signed-off-by: Matthew Heon <mheon@redhat.com>
Diffstat (limited to 'pkg/api/handlers')
-rw-r--r--pkg/api/handlers/compat/containers_attach.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/pkg/api/handlers/compat/containers_attach.go b/pkg/api/handlers/compat/containers_attach.go
index 5fc3117b9..012e20daf 100644
--- a/pkg/api/handlers/compat/containers_attach.go
+++ b/pkg/api/handlers/compat/containers_attach.go
@@ -94,7 +94,7 @@ func AttachContainer(w http.ResponseWriter, r *http.Request) {
return
}
} else if !(state == define.ContainerStateCreated || state == define.ContainerStateRunning) {
- utils.InternalServerError(w, errors.Wrapf(define.ErrCtrStateInvalid, "can only attach to created or running containers"))
+ utils.InternalServerError(w, errors.Wrapf(define.ErrCtrStateInvalid, "can only attach to created or running containers - currently in state %s", state.String()))
return
}