mirror of
https://github.com/Control-D-Inc/ctrld.git
synced 2026-07-16 13:17:19 +02:00
cmd/cli: only emit error for running interfaces
While at it, also ensure setDNS/resetDNS return a wrapped error on Darwin/Windows, so the caller can decide whether to print the error to users.
This commit is contained in:
committed by
Cuong Manh Le
parent
5145729ab1
commit
fdb82f6ec3
+3
-1
@@ -704,7 +704,9 @@ func withEachPhysicalInterfaces(excludeIfaceName, context string, f func(i *net.
|
||||
return
|
||||
}
|
||||
if err := f(netIface); err != nil {
|
||||
mainLog.Load().Warn().Err(err).Msgf("failed to %s for interface: %q", context, i.Name)
|
||||
if ifaceUp(netIface) {
|
||||
mainLog.Load().Warn().Err(err).Msgf("failed to %s for interface: %q", context, i.Name)
|
||||
}
|
||||
} else {
|
||||
mainLog.Load().Debug().Msgf("%s for interface %q successfully", context, i.Name)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user