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

Merge pull request #1323 from aboch/sbr

Return proper error types on sandbox creation
This commit is contained in:
Madhu Venugopal 2016-07-12 21:33:30 -07:00 committed by GitHub
commit 68e53443c9

View file

@ -806,7 +806,7 @@ func (c *controller) NewSandbox(containerID string, options ...SandboxOption) (s
// If not a stub, then we already have a complete sandbox.
if !s.isStub {
c.Unlock()
return nil, types.BadRequestErrorf("container %s is already present: %v", containerID, s)
return nil, types.ForbiddenErrorf("container %s is already present: %v", containerID, s)
}
// We already have a stub sandbox from the
@ -841,7 +841,7 @@ func (c *controller) NewSandbox(containerID string, options ...SandboxOption) (s
c.Lock()
if sb.ingress && c.ingressSandbox != nil {
c.Unlock()
return nil, fmt.Errorf("ingress sandbox already present")
return nil, types.ForbiddenErrorf("ingress sandbox already present")
}
if sb.ingress {