Skip to content

Commit

Permalink
Dedupe saml error check (#6551)
Browse files Browse the repository at this point in the history
  • Loading branch information
alexr00 authored Dec 16, 2024
1 parent 7c540d3 commit 798da62
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/common/authentication.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,5 @@ export class AuthenticationError extends Error {
}

export function isSamlError(e: { message?: string }): boolean {
return !!e.message?.startsWith('Resource protected by organization SAML enforcement.');
return !!e.message?.includes('Resource protected by organization SAML enforcement.');
}
2 changes: 1 addition & 1 deletion src/github/githubRepository.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1493,7 +1493,7 @@ export class GitHubRepository extends Disposable {
},
}, true); // There's an issue with the GetChecks that can result in SAML errors.
} catch (e) {
if (e.message?.startsWith('GraphQL error: Resource protected by organization SAML enforcement.')) {
if (isSamlError(e.message)) {
// There seems to be an issue with fetching status checks if you haven't SAML'd with every org you have
// The issue is specifically with the CheckSuite property. Make the query again, but without that property.
if (!captureUseFallbackChecks) {
Expand Down

0 comments on commit 798da62

Please sign in to comment.