From 2b73acdb6e2d2923e6afd94f10f1cf238a6e543c Mon Sep 17 00:00:00 2001 From: John Maguire Date: Fri, 1 Sep 2023 16:10:49 -0400 Subject: [PATCH] Use helper --- nebula/control.go | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/nebula/control.go b/nebula/control.go index 8e14bc0..042bc3c 100644 --- a/nebula/control.go +++ b/nebula/control.go @@ -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