refactor: improve log and error messages (#2708)

This commit is contained in:
CatsDeservePets authored and GitHub committed 2026-10-12 21:33:05 +02:00
1 parent 5d3c7b7025
commit 664d7c88e1
10 files changed
+55 -52

No files matched your search

+4 -4
View File
@@ -246,7 +246,7 @@ func matchFile(s string, dirOnly bool, escape, unescape func(string) string) (ma
}
files, err := os.ReadDir(d)
if err != nil {
log.Printf("reading directory: %s", err)
log.Printf("completing path: %s", err)
longest = s
return
}
@@ -316,7 +316,7 @@ func matchExec(s string) (matches []compMatch, longest string) {
files, err := os.ReadDir(p)
if err != nil {
if !os.IsNotExist(err) {
log.Printf("reading path: %s", err)
log.Printf("completing shell command: %s", err)
}
continue
}
@@ -328,7 +328,7 @@ func matchExec(s string) (matches []compMatch, longest string) {
finfo, err := f.Info()
if err != nil {
log.Printf("getting file information: %s", err)
log.Printf("completing shell command: %s", err)
continue
}
@@ -346,7 +346,7 @@ func matchExec(s string) (matches []compMatch, longest string) {
func matchSearch(s string) (matches []compMatch, longest string) {
files, err := os.ReadDir(".")
if err != nil {
log.Printf("reading directory: %s", err)
log.Printf("completing search: %s", err)
longest = s
return
}