summaryrefslogtreecommitdiff
path: root/pkg/api/handlers/utils/errors.go
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2020-05-18 21:58:23 +0200
committerGitHub <noreply@github.com>2020-05-18 21:58:23 +0200
commit9fe49335e0e9c11ab0b7148ba0c5d1426023d2fb (patch)
tree352474c7e23db0b8e2ca824024d2335cbcacec5d /pkg/api/handlers/utils/errors.go
parent1332c8b3abe814795c60c4dce7ee708470fc6177 (diff)
parent6287a5585223e5934706d1c1c21d68bfac5b5803 (diff)
downloadpodman-9fe49335e0e9c11ab0b7148ba0c5d1426023d2fb.tar.gz
podman-9fe49335e0e9c11ab0b7148ba0c5d1426023d2fb.tar.bz2
podman-9fe49335e0e9c11ab0b7148ba0c5d1426023d2fb.zip
Merge pull request #6249 from jwhonce/wip/resize
V2 Implement terminal handling in bindings attach
Diffstat (limited to 'pkg/api/handlers/utils/errors.go')
-rw-r--r--pkg/api/handlers/utils/errors.go8
1 files changed, 8 insertions, 0 deletions
diff --git a/pkg/api/handlers/utils/errors.go b/pkg/api/handlers/utils/errors.go
index 3253a9be3..c17720694 100644
--- a/pkg/api/handlers/utils/errors.go
+++ b/pkg/api/handlers/utils/errors.go
@@ -63,6 +63,14 @@ func PodNotFound(w http.ResponseWriter, name string, err error) {
Error(w, msg, http.StatusNotFound, err)
}
+func SessionNotFound(w http.ResponseWriter, name string, err error) {
+ if errors.Cause(err) != define.ErrNoSuchExecSession {
+ InternalServerError(w, err)
+ }
+ msg := fmt.Sprintf("No such exec session: %s", name)
+ Error(w, msg, http.StatusNotFound, err)
+}
+
func ContainerNotRunning(w http.ResponseWriter, containerID string, err error) {
msg := fmt.Sprintf("Container %s is not running", containerID)
Error(w, msg, http.StatusConflict, err)