mirror of
https://github.com/taigrr/systemctl.git
synced 2026-03-09 00:14:38 -07:00
Migrates many tests to errors_test
This commit is contained in:
6
util.go
6
util.go
@@ -53,6 +53,12 @@ func filterErr(stderr string) error {
|
||||
if matched, _ := regexp.MatchString(`does not exist`, stderr); matched {
|
||||
return ErrDoesNotExist
|
||||
}
|
||||
if matched, _ := regexp.MatchString(`not found.`, stderr); matched {
|
||||
return ErrDoesNotExist
|
||||
}
|
||||
if matched, _ := regexp.MatchString(`not loaded.`, stderr); matched {
|
||||
return ErrUnitNotLoaded
|
||||
}
|
||||
if matched, _ := regexp.MatchString(`No such file or directory`, stderr); matched {
|
||||
return ErrDoesNotExist
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user