Bitbucket: handle missing authentication response from API returning 404 status code (#10657)
parent
44c1ff717d
commit
eb0aaa7472
|
@ -390,7 +390,7 @@ class GitBitbucketDriver extends VcsDriver
|
||||||
} catch (TransportException $e) {
|
} catch (TransportException $e) {
|
||||||
$bitbucketUtil = new Bitbucket($this->io, $this->config, $this->process, $this->httpDownloader);
|
$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)
|
if (!$this->io->hasAuthentication($this->originUrl)
|
||||||
&& $bitbucketUtil->authorizeOAuth($this->originUrl)
|
&& $bitbucketUtil->authorizeOAuth($this->originUrl)
|
||||||
) {
|
) {
|
||||||
|
|
Loading…
Reference in New Issue