Skip to content

Commit

Permalink
Fix bug which mistakes 400 error for 500
Browse files Browse the repository at this point in the history
Signed-off-by: Wang Xing <hzwangxing@corp.netease.com>
  • Loading branch information
Wang Xing committed May 19, 2016
1 parent 1691fe6 commit beca261
Show file tree
Hide file tree
Showing 9 changed files with 10 additions and 0 deletions.
1 change: 1 addition & 0 deletions api/server/httputils/errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ func GetHTTPErrorStatusCode(err error) int {
"not found": http.StatusNotFound,
"no such": http.StatusNotFound,
"bad parameter": http.StatusBadRequest,
"no command": http.StatusBadRequest,
"conflict": http.StatusConflict,
"impossible": http.StatusNotAcceptable,
"wrong login/password": http.StatusUnauthorized,
Expand Down
2 changes: 2 additions & 0 deletions docs/reference/api/docker_remote_api.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 /networks` now supports filtering by `label` and `driver`.
* `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

Expand Down
1 change: 1 addition & 0 deletions docs/reference/api/docker_remote_api_v1.18.md
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,7 @@ Query Parameters:
Status Codes:

- **201** – no error
- **400** – bad parameter
- **404** – no such container
- **406** – impossible to attach (container not running)
- **500** – server error
Expand Down
1 change: 1 addition & 0 deletions docs/reference/api/docker_remote_api_v1.19.md
Original file line number Diff line number Diff line change
Expand Up @@ -303,6 +303,7 @@ Query Parameters:
Status Codes:

- **201** – no error
- **400** – bad parameter
- **404** – no such container
- **406** – impossible to attach (container not running)
- **500** – server error
Expand Down
1 change: 1 addition & 0 deletions docs/reference/api/docker_remote_api_v1.20.md
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,7 @@ Query Parameters:
Status Codes:

- **201** – no error
- **400** – bad parameter
- **404** – no such container
- **406** – impossible to attach (container not running)
- **500** – server error
Expand Down
1 change: 1 addition & 0 deletions docs/reference/api/docker_remote_api_v1.21.md
Original file line number Diff line number Diff line change
Expand Up @@ -330,6 +330,7 @@ Query Parameters:
Status Codes:

- **201** – no error
- **400** – bad parameter
- **404** – no such container
- **406** – impossible to attach (container not running)
- **500** – server error
Expand Down
1 change: 1 addition & 0 deletions docs/reference/api/docker_remote_api_v1.22.md
Original file line number Diff line number Diff line change
Expand Up @@ -438,6 +438,7 @@ Query Parameters:
Status Codes:

- **201** – no error
- **400** – bad parameter
- **404** – no such container
- **406** – impossible to attach (container not running)
- **500** – server error
Expand Down
1 change: 1 addition & 0 deletions docs/reference/api/docker_remote_api_v1.23.md
Original file line number Diff line number Diff line change
Expand Up @@ -461,6 +461,7 @@ Query Parameters:
Status Codes:

- **201** – no error
- **400** – bad parameter
- **404** – no such container
- **406** – impossible to attach (container not running)
- **500** – server error
Expand Down
1 change: 1 addition & 0 deletions docs/reference/api/docker_remote_api_v1.24.md
Original file line number Diff line number Diff line change
Expand Up @@ -470,6 +470,7 @@ Query Parameters:
Status Codes:

- **201** – no error
- **400** – bad parameter
- **404** – no such container
- **406** – impossible to attach (container not running)
- **500** – server error
Expand Down

0 comments on commit beca261

Please sign in to comment.