From a5e2e397846b6e7bb83d3d5d9dd8d510bc3c9de2 Mon Sep 17 00:00:00 2001 From: lew Date: Wed, 19 Nov 2025 15:12:58 +0000 Subject: [PATCH] fix(Get): Errors should be reported by their executing shell; all errors were bubbling up to PDA where they should not be --- cmd/get.go | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/cmd/get.go b/cmd/get.go index 42167cf..f510295 100644 --- a/cmd/get.go +++ b/cmd/get.go @@ -100,12 +100,15 @@ func runCmd(command string) error { cmd.Stdin = os.Stdin if err := cmd.Run(); err != nil { - // Manually relay the error returned from the sub-command. - fmt.Fprintf(os.Stderr, "%v\n", err) + // ExitError indicates running the command was successful, but the command itself failed. + // We only ever want to report on errors caused by the CLI tool itself. + // An ExitError means this tool was successful in running the command, so return nil. + // A non-ExitError means this tool failed, so return err. + if _, ok := err.(*exec.ExitError); !ok { + return err + } } - // Never bubble this error up to PDA itself, - // because if it ran at all then PDA did not error. - // Arbitrary user commands should handle their own errors. + return nil }