Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mark permission issues as downstream #389

Merged
merged 2 commits into from
Nov 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading