Skip to content

feat(issue-comment): add 403 handling to Update-IssueComment function #701

@rjmurillo-bot

Description

@rjmurillo-bot

Summary

The Update-IssueComment function in GitHubCore.psm1 lacks the 403-specific error handling that was added to Post-IssueComment.ps1 in PR #698.

Problem

When updating an existing comment fails with 403 Permission Denied, users get a generic error message instead of the actionable guidance provided for new comment posts.

Current behavior in Update-IssueComment:

if ($LASTEXITCODE -ne 0) {
    Write-ErrorAndExit "Failed to update comment: $result" 3
}

Expected behavior (matching Post-IssueComment.ps1):

  • Detect 403 errors specifically
  • Provide actionable guidance for permission issues
  • Save failed payload for debugging
  • Use exit code 5 (or 4 per ADR-035 alignment)

User Impact

A user might have permission to read comments but not edit them. When they try to update an existing comment and get 403, they see "Failed to update comment" instead of:

  • Which permission is missing
  • How to fix it for different auth types
  • The payload they were trying to post

Solution

Apply the same 403 handling pattern from Post-IssueComment.ps1 to Update-IssueComment:

  1. Detect 403 in error response
  2. Call Write-PermissionDeniedError or similar
  3. Use appropriate exit code
  4. Save artifact for debugging

Affected Files

  • .claude/skills/github/modules/GitHubCore.psm1 - Update-IssueComment function

Related


🤖 Generated with Claude Code

Metadata

Metadata

Assignees

Labels

area-promptsAgent prompts and templatesarea-skillsSkills documentation and patternsenhancementNew feature or requestgood first issueGood for newcomerspriority:P2Normal: Standard enhancement or bug fix, moderate impactquestionFurther information is requested

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions