From 3b546dc29aaeaf5f91d6107f1e716a01bbe13701 Mon Sep 17 00:00:00 2001 From: Brad Fitzpatrick Date: Mon, 4 May 2020 07:44:41 -0700 Subject: [PATCH] portlist: make two error paths have unique messages For debugging #339 --- portlist/portlist_linux.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/portlist/portlist_linux.go b/portlist/portlist_linux.go index 26cf52fe4..0e4088635 100644 --- a/portlist/portlist_linux.go +++ b/portlist/portlist_linux.go @@ -110,7 +110,7 @@ func addProcesses(pl []Port) ([]Port, error) { return nil } if err != nil { - return fmt.Errorf("readdir: %w", err) + return fmt.Errorf("addProcesses.readDir: %w", err) } for _, fd := range fds { n, err := unix.Readlink(fmt.Sprintf("/proc/%s/fd/%s", pid, fd), targetBuf) @@ -155,7 +155,7 @@ func foreachPID(fn func(pidStr string) error) error { return nil } if err != nil { - return err + return fmt.Errorf("foreachPID.readdir: %w", err) } for _, pid := range pids {