Wrap errors in GetPullRequest and PostReview for consistency

Add fmt.Errorf wrapping to the two remaining unwrapped error returns
in the adapter:
- GetPullRequest: 'get pull request: %w'
- PostReview (final client call): 'post review: %w'

This makes all error paths in the adapter consistent with the wrapping
pattern used by the diff-fetch and position-translation errors.

Addresses self-review findings #1 and #2 from b2eea502.
This commit is contained in:
claw
2026-05-12 14:56:55 -07:00
parent c86510b65d
commit 3245fecd44
+2 -2
View File
@@ -34,7 +34,7 @@ func (a *Adapter) Underlying() *Client {
func (a *Adapter) GetPullRequest(ctx context.Context, owner, repo string, number int) (*vcs.PullRequest, error) {
pr, err := a.client.GetPullRequest(ctx, owner, repo, number)
if err != nil {
return nil, err
return nil, fmt.Errorf("get pull request: %w", err)
}
return &vcs.PullRequest{
Number: number,
@@ -180,7 +180,7 @@ func (a *Adapter) PostReview(ctx context.Context, owner, repo string, number int
review, err := a.client.PostReview(ctx, owner, repo, number, event, req.Body, giteaComments)
if err != nil {
return nil, err
return nil, fmt.Errorf("post review: %w", err)
}
return &vcs.Review{