Fix: "not found" should not be an error

if it shows nothing, it can be understood as easily as a grep returning
nothing
adding an error log is too verbose
This commit is contained in:
Yoann La Cancellera
2023-09-20 11:37:42 +02:00
parent fea9be26bd
commit 75ce300d7c

View File

@@ -135,7 +135,7 @@ func execGrepAndIterate(path, compiledRegex string, stdout chan<- string) error
// double-check it stopped correctly
if err = cmd.Wait(); err != nil {
if exiterr, ok := err.(*exec.ExitError); ok && exiterr.ExitCode() == 1 {
return errors.New("found nothing")
return nil
}
return errors.Wrap(err, "grep subprocess error")
}