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
ctrl, err := nebula.Main(c, false, "", l, &tunFd)
if err != nil {
switch v := err.(type) {
case *util.ContextualError:
v.Log(l)
return nil, v.Unwrap()
default:
l.WithError(err).Error("Failed to start")
return nil, err
}
util.LogWithContextIfNeeded("Failed to start", err, l)
}
return &Nebula{ctrl, l, c}, nil