1
0
Fork 0

Do not retry failures once degraded mode is already enabled

pull/4262/merge
Jordi Boggiano 2015-07-20 17:44:03 +01:00
parent ff84b32097
commit bbf959ac34
1 changed files with 6 additions and 2 deletions

View File

@ -191,7 +191,7 @@ class RemoteFilesystem
}
restore_error_handler();
if (isset($e) && !$this->retry) {
if (false !== strpos($e->getMessage(), 'Operation timed out')) {
if (!$this->degradedMode && false !== strpos($e->getMessage(), 'Operation timed out')) {
$this->degradedMode = true;
$this->io->writeError(array(
'<error>'.$e->getMessage().'</error>',
@ -244,6 +244,10 @@ class RemoteFilesystem
throw new TransportException('Failed to decode zlib stream');
}
} catch (\Exception $e) {
if ($this->degradedMode) {
throw $e;
}
$this->degradedMode = true;
$this->io->writeError(array(
'<error>Failed to decode response: '.$e->getMessage().'</error>',
@ -293,7 +297,7 @@ class RemoteFilesystem
$e->setHeaders($http_response_header);
}
if (false !== strpos($e->getMessage(), 'Operation timed out')) {
if (!$this->degradedMode && false !== strpos($e->getMessage(), 'Operation timed out')) {
$this->degradedMode = true;
$this->io->writeError(array(
'<error>'.$e->getMessage().'</error>',