Make exec start return proper error codes

Exec start was sending HTTP 500 for every error.

Fixed an error where pausing a container and then calling exec start
caused the daemon to freeze.

Updated API docs which incorrectly showed that a successful exec start
was an HTTP 201, in reality it is HTTP 200.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
This commit is contained in:
Brian Goff
2015-10-02 14:40:22 -04:00
parent 698e14902a
commit 2d43d93410
12 changed files with 102 additions and 43 deletions
+2 -2
View File
@@ -654,7 +654,7 @@ var (
Value: "CONTAINERNOTRUNNING",
Message: "Container %s is not running: %s",
Description: "An attempt was made to retrieve the information about an 'exec' but the container is not running",
HTTPStatusCode: http.StatusInternalServerError,
HTTPStatusCode: http.StatusConflict,
})
// ErrorCodeNoExecID is generated when we try to get the info
@@ -672,7 +672,7 @@ var (
Value: "EXECPAUSED",
Message: "Container %s is paused, unpause the container before exec",
Description: "An attempt to start an 'exec' was made, but the owning container is paused",
HTTPStatusCode: http.StatusInternalServerError,
HTTPStatusCode: http.StatusConflict,
})
// ErrorCodeExecRunning is generated when we try to start an exec