3
0
Fork 0

Use helper

This commit is contained in:
John Maguire 2023-09-01 16:10:49 -04:00
parent 7b94011f51
commit 2b73acdb6e
1 changed files with 1 additions and 8 deletions

View File

@ -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