diff --git a/src/Composer/Util/RemoteFilesystem.php b/src/Composer/Util/RemoteFilesystem.php
index ce30b83a7..edcc465c7 100644
--- a/src/Composer/Util/RemoteFilesystem.php
+++ b/src/Composer/Util/RemoteFilesystem.php
@@ -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(
''.$e->getMessage().'',
@@ -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(
'Failed to decode response: '.$e->getMessage().'',
@@ -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(
''.$e->getMessage().'',