Skip to content

Commit

Permalink
Mark permission issues as downstream (#389)
Browse files Browse the repository at this point in the history
  • Loading branch information
ivanahuckova authored Nov 19, 2024
1 parent 4a30382 commit bea08d6
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions pkg/github/client/errorsourcehandling.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ var (
"Your token has not been granted the required scopes to execute this query",
"Resource protected by organization SAML enforcement. You must grant your Personal Access token access to this organization.",
"API rate limit exceeded",
"Resource not accessible by integration", // issue with incorrectly set permissions for token/app
}
)

Expand Down
6 changes: 6 additions & 0 deletions pkg/github/client/errorsourcehandling_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,12 @@ func TestAddErrorSourceToError(t *testing.T) {
resp: nil,
expected: errorsource.DownstreamError(errors.New("API rate limit exceeded for ID 1"), false),
},
{
name: "permission error message",
err: errors.New("Resource not accessible by integration"),
resp: nil,
expected: errorsource.DownstreamError(errors.New("Resource not accessible by integration"), false),
},
}

for _, tt := range tests {
Expand Down

0 comments on commit bea08d6

Please sign in to comment.