mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Return proper error types on sandbox creation
Signed-off-by: Alessandro Boch <aboch@docker.com>
This commit is contained in:
parent
e4957174ee
commit
2e88dfa406
1 changed files with 2 additions and 2 deletions
|
@ -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
|
||||
|
@ -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 {
|
||||
|
|
Loading…
Add table
Reference in a new issue