1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00

Fix bug which mistakes 400 error for 500

Signed-off-by: Wang Xing <hzwangxing@corp.netease.com>
This commit is contained in:
Wang Xing 2016-05-16 17:15:45 +08:00
parent 1691fe6d23
commit beca261578
9 changed files with 10 additions and 0 deletions

View file

@ -49,6 +49,7 @@ func GetHTTPErrorStatusCode(err error) int {
"not found": http.StatusNotFound, "not found": http.StatusNotFound,
"no such": http.StatusNotFound, "no such": http.StatusNotFound,
"bad parameter": http.StatusBadRequest, "bad parameter": http.StatusBadRequest,
"no command": http.StatusBadRequest,
"conflict": http.StatusConflict, "conflict": http.StatusConflict,
"impossible": http.StatusNotAcceptable, "impossible": http.StatusNotAcceptable,
"wrong login/password": http.StatusUnauthorized, "wrong login/password": http.StatusUnauthorized,

View file

@ -116,6 +116,8 @@ This section lists each version from latest to oldest. Each listing includes a
* `GET /info` now returns `SecurityOptions` field, showing if `apparmor`, `seccomp`, or `selinux` is supported. * `GET /info` now returns `SecurityOptions` field, showing if `apparmor`, `seccomp`, or `selinux` is supported.
* `GET /networks` now supports filtering by `label` and `driver`. * `GET /networks` now supports filtering by `label` and `driver`.
* `POST /containers/create` now takes `MaximumIOps` and `MaximumIOBps` fields. Windows daemon only. * `POST /containers/create` now takes `MaximumIOps` and `MaximumIOBps` fields. Windows daemon only.
* `POST /containers/create` now returns a HTTP 400 "bad parameter" message
if no command is specified (instead of a HTTP 500 "server error")
### v1.23 API changes ### v1.23 API changes

View file

@ -292,6 +292,7 @@ Query Parameters:
Status Codes: Status Codes:
- **201** no error - **201** no error
- **400** bad parameter
- **404** no such container - **404** no such container
- **406** impossible to attach (container not running) - **406** impossible to attach (container not running)
- **500** server error - **500** server error

View file

@ -303,6 +303,7 @@ Query Parameters:
Status Codes: Status Codes:
- **201** no error - **201** no error
- **400** bad parameter
- **404** no such container - **404** no such container
- **406** impossible to attach (container not running) - **406** impossible to attach (container not running)
- **500** server error - **500** server error

View file

@ -307,6 +307,7 @@ Query Parameters:
Status Codes: Status Codes:
- **201** no error - **201** no error
- **400** bad parameter
- **404** no such container - **404** no such container
- **406** impossible to attach (container not running) - **406** impossible to attach (container not running)
- **500** server error - **500** server error

View file

@ -330,6 +330,7 @@ Query Parameters:
Status Codes: Status Codes:
- **201** no error - **201** no error
- **400** bad parameter
- **404** no such container - **404** no such container
- **406** impossible to attach (container not running) - **406** impossible to attach (container not running)
- **500** server error - **500** server error

View file

@ -438,6 +438,7 @@ Query Parameters:
Status Codes: Status Codes:
- **201** no error - **201** no error
- **400** bad parameter
- **404** no such container - **404** no such container
- **406** impossible to attach (container not running) - **406** impossible to attach (container not running)
- **500** server error - **500** server error

View file

@ -461,6 +461,7 @@ Query Parameters:
Status Codes: Status Codes:
- **201** no error - **201** no error
- **400** bad parameter
- **404** no such container - **404** no such container
- **406** impossible to attach (container not running) - **406** impossible to attach (container not running)
- **500** server error - **500** server error

View file

@ -470,6 +470,7 @@ Query Parameters:
Status Codes: Status Codes:
- **201** no error - **201** no error
- **400** bad parameter
- **404** no such container - **404** no such container
- **406** impossible to attach (container not running) - **406** impossible to attach (container not running)
- **500** server error - **500** server error