fix(issue): name missing issues and attachments in errors

tea issue close 999 printed "issue 999: not found (HTTP 404 GET …)" and
issue attachment view 1 9 blamed issue #1 for a missing attachment.
Batch commands (issue close, reopen, edit, milestone issue add and
remove) now report "issue 999: not found in alice/x", and attachment
commands "attachment 9 not found in alice/x#1".

Signed-off-by: bircni <bircni@icloud.com>
This commit is contained in:
bircni committed 2026-10-12 00:17:08 +02:00
1 parent 56c6ffc80b
commit 01ced23a4a
5 files changed
+64 -15

No files matched your search

+5 -3
View File
@@ -109,7 +109,8 @@ $ tea issue edit 12 --body-file notes.md`, Annotations: map[string]string{"tea.a
opts.Body = &draft.Body
}
return batchDone(a, cmd, numbers, issueLabel, func(n int64) (services.Issue, error) {
return service.Edit(cmd.Context(), n, opts)
item, err := service.Edit(cmd.Context(), n, opts)
return item, itemError(err, target.Repo)
}, editedIssue(target))
}}
flags := cmd.Flags()
@@ -147,7 +148,7 @@ func (a *application) editIssuesInteractively(cmd *cobra.Command, target target,
return batchDone(a, cmd, numbers, issueLabel, func(n int64) (item services.Issue, err error) {
current, err := service.View(cmd.Context(), n)
if err != nil {
return item, err
return item, itemError(err, target.Repo)
}
choices := terminal.IssueEditFormChoices{
Heading: "Editing " + refLabel(target.Repo, n, current.Title),
@@ -182,6 +183,7 @@ func (a *application) editIssuesInteractively(cmd *cobra.Command, target target,
opts.RemoveDeadline = &values.ClearDeadline
}
}
return service.Edit(cmd.Context(), n, opts)
item, err = service.Edit(cmd.Context(), n, opts)
return item, itemError(err, target.Repo)
}, editedIssue(target))
}