fix(report): Error when GitHub integration failed (#800)
This commit is contained in:
@@ -125,11 +125,7 @@ func parallelExec(fn func(osTypeInterface) error, timeoutSec ...int) {
|
||||
if len(s.getErrs()) == 0 {
|
||||
successes = append(successes, s)
|
||||
} else {
|
||||
fmtstr := "Error on %s, err: %s"
|
||||
if conf.Conf.Debug {
|
||||
fmtstr = "Error: %s, err: %+v"
|
||||
}
|
||||
util.Log.Errorf(fmtstr,
|
||||
util.Log.Errorf("Error on %s, err: %+v",
|
||||
s.getServerInfo().GetServerName(), s.getErrs())
|
||||
errServers = append(errServers, s)
|
||||
}
|
||||
@@ -150,10 +146,10 @@ func parallelExec(fn func(osTypeInterface) error, timeoutSec ...int) {
|
||||
}
|
||||
}
|
||||
if !found {
|
||||
msg := fmt.Sprintf("Timed out: %s",
|
||||
err := xerrors.Errorf("Timed out: %s",
|
||||
s.getServerInfo().GetServerName())
|
||||
util.Log.Errorf(msg)
|
||||
s.setErrs([]error{xerrors.New(msg)})
|
||||
util.Log.Errorf("%+v", err)
|
||||
s.setErrs([]error{err})
|
||||
errServers = append(errServers, s)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -215,7 +215,7 @@ func detectServerOSes(timeoutSec int) (servers, errServers []osTypeInterface) {
|
||||
case res := <-osTypeChan:
|
||||
if 0 < len(res.getErrs()) {
|
||||
errServers = append(errServers, res)
|
||||
util.Log.Errorf("(%d/%d) Failed: %s, err: %s",
|
||||
util.Log.Errorf("(%d/%d) Failed: %s, err: %+v",
|
||||
i+1, len(config.Conf.Servers),
|
||||
res.getServerInfo().ServerName,
|
||||
res.getErrs())
|
||||
@@ -279,7 +279,7 @@ func detectContainerOSes(timeoutSec int) (actives, inactives []osTypeInterface)
|
||||
sinfo := osi.getServerInfo()
|
||||
if 0 < len(osi.getErrs()) {
|
||||
inactives = append(inactives, osi)
|
||||
util.Log.Errorf("Failed: %s err: %s", sinfo.ServerName, osi.getErrs())
|
||||
util.Log.Errorf("Failed: %s err: %+v", sinfo.ServerName, osi.getErrs())
|
||||
continue
|
||||
}
|
||||
actives = append(actives, osi)
|
||||
@@ -600,7 +600,7 @@ func scanVulns(jsonDir string, scannedAt time.Time, timeoutSec int) error {
|
||||
hostname, _ := os.Hostname()
|
||||
ipv4s, ipv6s, err := util.IP()
|
||||
if err != nil {
|
||||
util.Log.Errorf("Failed to fetch scannedIPs: %s", err)
|
||||
util.Log.Errorf("Failed to fetch scannedIPs. err: %+v", err)
|
||||
}
|
||||
|
||||
for _, s := range append(servers, errServers...) {
|
||||
|
||||
Reference in New Issue
Block a user