fix(resume): capture error in handoff message fallback (#583)
When JSON parsing of inbox output fails, the code falls back to plain text mode. However, the error from the fallback `gt mail inbox` command was being silently ignored with `_`, masking failures and making debugging difficult. This change properly captures and returns the error if the fallback command fails. Co-authored-by: Gastown Bot <bot@gastown.ai> Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -257,7 +257,10 @@ func checkHandoffMessages() error {
|
||||
if err := json.Unmarshal(output, &messages); err != nil {
|
||||
// JSON parse failed, use plain text output
|
||||
inboxCmd = exec.Command("gt", "mail", "inbox")
|
||||
output, _ = inboxCmd.Output()
|
||||
output, err = inboxCmd.Output()
|
||||
if err != nil {
|
||||
return fmt.Errorf("fallback inbox check failed: %w", err)
|
||||
}
|
||||
outputStr := string(output)
|
||||
if containsHandoff(outputStr) {
|
||||
fmt.Printf("%s Found handoff message(s):\n\n", style.Bold.Render("🤝"))
|
||||
|
||||
Reference in New Issue
Block a user