sandbox: return error on doubled start
Signed-off-by: Ophestra <cat@gensokyo.uk>
This commit is contained in:
parent
e64e7608ca
commit
4230281194
@ -3,6 +3,7 @@ package sandbox
|
|||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"encoding/gob"
|
"encoding/gob"
|
||||||
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
"io"
|
"io"
|
||||||
"os"
|
"os"
|
||||||
@ -111,7 +112,7 @@ type (
|
|||||||
|
|
||||||
func (p *Container) Start() error {
|
func (p *Container) Start() error {
|
||||||
if p.cmd != nil {
|
if p.cmd != nil {
|
||||||
panic("attempted to start twice")
|
return errors.New("sandbox: already started")
|
||||||
}
|
}
|
||||||
|
|
||||||
c, cancel := context.WithCancel(p.ctx)
|
c, cancel := context.WithCancel(p.ctx)
|
||||||
|
Loading…
Reference in New Issue
Block a user