fix(convoy): capture stderr for 'couldn't track issue' warnings
The bd dep add command was failing with only "exit status 1" shown because stderr wasn't being captured. Now shows actual error message. Fixes: gt-g8eqq5 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
committed by
Steve Yegge
parent
0cc4867ad7
commit
8880c61067
@@ -344,9 +344,15 @@ func runConvoyCreate(cmd *cobra.Command, args []string) error {
|
||||
depArgs := []string{"dep", "add", convoyID, issueID, "--type=tracks"}
|
||||
depCmd := exec.Command("bd", depArgs...)
|
||||
depCmd.Dir = townBeads
|
||||
var depStderr bytes.Buffer
|
||||
depCmd.Stderr = &depStderr
|
||||
|
||||
if err := depCmd.Run(); err != nil {
|
||||
style.PrintWarning("couldn't track %s: %v", issueID, err)
|
||||
errMsg := strings.TrimSpace(depStderr.String())
|
||||
if errMsg == "" {
|
||||
errMsg = err.Error()
|
||||
}
|
||||
style.PrintWarning("couldn't track %s: %s", issueID, errMsg)
|
||||
} else {
|
||||
trackedCount++
|
||||
}
|
||||
@@ -434,9 +440,15 @@ func runConvoyAdd(cmd *cobra.Command, args []string) error {
|
||||
depArgs := []string{"dep", "add", convoyID, issueID, "--type=tracks"}
|
||||
depCmd := exec.Command("bd", depArgs...)
|
||||
depCmd.Dir = townBeads
|
||||
var depStderr bytes.Buffer
|
||||
depCmd.Stderr = &depStderr
|
||||
|
||||
if err := depCmd.Run(); err != nil {
|
||||
style.PrintWarning("couldn't add %s: %v", issueID, err)
|
||||
errMsg := strings.TrimSpace(depStderr.String())
|
||||
if errMsg == "" {
|
||||
errMsg = err.Error()
|
||||
}
|
||||
style.PrintWarning("couldn't add %s: %s", issueID, errMsg)
|
||||
} else {
|
||||
addedCount++
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user