summaryrefslogtreecommitdiff
path: root/pkg/api/handlers/utils/errors.go
diff options
context:
space:
mode:
authorJhon Honce <jhonce@redhat.com>2020-05-15 09:33:21 -0700
committerJhon Honce <jhonce@redhat.com>2020-05-18 11:21:06 -0700
commit6287a5585223e5934706d1c1c21d68bfac5b5803 (patch)
tree835ea460df979073ce36050149b105eed7a4a2ae /pkg/api/handlers/utils/errors.go
parentd4587c6074e4b4e3673cf495f0c4cd2811742791 (diff)
downloadpodman-6287a5585223e5934706d1c1c21d68bfac5b5803.tar.gz
podman-6287a5585223e5934706d1c1c21d68bfac5b5803.tar.bz2
podman-6287a5585223e5934706d1c1c21d68bfac5b5803.zip
V2 Implement terminal handling in bindings attach
* Add support for /exec/{id}/resize * Add support for ErrSessionNotFound * Resize container TTY as stdin changes size * Refactor all resize functions into one handler Signed-off-by: Jhon Honce <jhonce@redhat.com>
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)