Use helper
This commit is contained in:
parent
7b94011f51
commit
2b73acdb6e
|
@ -53,14 +53,7 @@ func NewNebula(configData string, key string, logFile string, tunFd int) (*Nebul
|
||||||
//TODO: inject our version
|
//TODO: inject our version
|
||||||
ctrl, err := nebula.Main(c, false, "", l, &tunFd)
|
ctrl, err := nebula.Main(c, false, "", l, &tunFd)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
switch v := err.(type) {
|
util.LogWithContextIfNeeded("Failed to start", err, l)
|
||||||
case *util.ContextualError:
|
|
||||||
v.Log(l)
|
|
||||||
return nil, v.Unwrap()
|
|
||||||
default:
|
|
||||||
l.WithError(err).Error("Failed to start")
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return &Nebula{ctrl, l, c}, nil
|
return &Nebula{ctrl, l, c}, nil
|
||||||
|
|
Loading…
Reference in New Issue