Handle GitHub "Repository access blocked" error (#13648)

* Handle GitHub "Repository access blocked" error

We've been seeing a lot of these errors on DEV, and it's a pretty
reasonable expectation that if we're being blocked from seeing them
using the user's OAuth access token that this isn't temporary.

* Re-raise so we don't swallow this error

* Constant name != company name???!?!?!
This commit is contained in:
Jamie Gaskins 2021-05-05 12:48:46 -04:00 committed by GitHub
parent 9970b1c2d5
commit a2da070ca4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -37,6 +37,12 @@ module GithubRepos
Github::Errors::AccountSuspended,
Github::Errors::RepositoryUnavailable
repo.destroy
rescue Github::Errors::ClientError => e
if e.message.include? "Repository access blocked"
repo.destroy
else
raise e
end
end
end
end