Skip to content

Commit

Permalink
print sysinfo results even if failure
Browse files Browse the repository at this point in the history
  • Loading branch information
emosbaugh committed Nov 26, 2024
1 parent c5afe54 commit f0b3ca5
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions cmd/sysinfo/sysinfo.go
Original file line number Diff line number Diff line change
Expand Up @@ -143,16 +143,18 @@ func collectAndPrint(probe probes.Probe, out io.Writer, marshal func(any) ([]byt
if err := probe.Probe(&c); err != nil {
return err
}
if c.failed {
return errors.New("sysinfo failed")
}
bytes, err := marshal(c.results)
if err != nil {
return err
}

_, err = out.Write(bytes)
return err
if err != nil {
return err
}
if c.failed {
return errors.New("sysinfo failed")
}
return nil
}

func (r *cliReporter) printf(format interface{}, args ...interface{}) error {
Expand Down

0 comments on commit f0b3ca5

Please sign in to comment.