Bitbucket: handle missing authentication response from API returning 404 status code (#10657)

main
Stephan 2 years ago committed by GitHub
parent 44c1ff717d
commit eb0aaa7472
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -390,7 +390,7 @@ class GitBitbucketDriver extends VcsDriver
} catch (TransportException $e) {
$bitbucketUtil = new Bitbucket($this->io, $this->config, $this->process, $this->httpDownloader);
if (403 === $e->getCode() || (401 === $e->getCode() && strpos($e->getMessage(), 'Could not authenticate against') === 0)) {
if (in_array($e->getCode(), array(403, 404), true) || (401 === $e->getCode() && strpos($e->getMessage(), 'Could not authenticate against') === 0)) {
if (!$this->io->hasAuthentication($this->originUrl)
&& $bitbucketUtil->authorizeOAuth($this->originUrl)
) {

Loading…
Cancel
Save