1
0
mirror of https://github.com/moby/moby.git synced 2025-08-08 13:22:22 +03:00

Return remote API errors as JSON

Signed-off-by: Ben Firshman <ben@firshman.co.uk>
This commit is contained in:
Ben Firshman
2016-05-21 12:56:04 +01:00
parent f6ff9acc63
commit 322e2a7d05
13 changed files with 135 additions and 59 deletions

View File

@@ -85,8 +85,8 @@ func (s *DockerSuite) TestGetContainersWsAttachContainerNotFound(c *check.C) {
status, body, err := sockRequest("GET", "/containers/doesnotexist/attach/ws", nil)
c.Assert(status, checker.Equals, http.StatusNotFound)
c.Assert(err, checker.IsNil)
expected := "No such container: doesnotexist\n"
c.Assert(string(body), checker.Contains, expected)
expected := "No such container: doesnotexist"
c.Assert(getErrorMessage(c, body), checker.Contains, expected)
}
func (s *DockerSuite) TestPostContainersAttach(c *check.C) {