Skip to content

Commit

Permalink
Return proper error types on sandbox creation
Browse files Browse the repository at this point in the history
Signed-off-by: Alessandro Boch <aboch@docker.com>
  • Loading branch information
aboch committed Jul 13, 2016
1 parent 9b821dc commit 4b3b405
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -801,7 +801,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
Expand Down Expand Up @@ -836,7 +836,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 {
Expand Down

0 comments on commit 4b3b405

Please sign in to comment.