Improve: "not found" error handling

This commit is contained in:
Yoann La Cancellera
2023-09-01 16:56:29 +02:00
parent b4cad31e77
commit b054429057

View File

@@ -212,6 +212,9 @@ func (e *extractor) search() (types.LocalTimeline, error) {
// double-check it stopped correctly
if err = cmd.Wait(); err != nil {
if exiterr, ok := err.(*exec.ExitError); ok && exiterr.ExitCode() == 1 {
return nil, errors.New("Found nothing")
}
return nil, errors.Wrap(err, "grep subprocess error")
}