From 8b5ff21db78b3e126489974af27c568f8225f571 Mon Sep 17 00:00:00 2001 From: Simon Ruderich Date: Sun, 3 Nov 2024 09:25:33 +0100 Subject: [PATCH] Improve error message when parsing output of `ip netns pids` This is very unlikely to fail but debugging such errors is painful without the original output. --- main.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.go b/main.go index 08c9a56..0cf8c84 100644 --- a/main.go +++ b/main.go @@ -176,7 +176,7 @@ func netnsPids(netns string) []int { for _, x := range xs { y, err := strconv.Atoi(x) if err != nil { - log.Fatal(err) + log.Fatalf("invalid output from %q: %q: %v", xargs, out, err) } res = append(res, y) } -- 2.45.2