From 665a2bd0c0d2a0a6e2f57bc9b2d518b592cf2cc5 Mon Sep 17 00:00:00 2001 From: Jordi Boggiano Date: Tue, 25 Feb 2014 13:34:39 +0100 Subject: [PATCH] Tweak error message and make TransportException extend from RuntimeException, refs #2753 --- src/Composer/Downloader/DownloadManager.php | 9 ++++++--- src/Composer/Downloader/TransportException.php | 2 +- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/Composer/Downloader/DownloadManager.php b/src/Composer/Downloader/DownloadManager.php index ab35d488f..f2296d7d7 100644 --- a/src/Composer/Downloader/DownloadManager.php +++ b/src/Composer/Downloader/DownloadManager.php @@ -191,6 +191,9 @@ class DownloadManager $this->filesystem->ensureDirectoryExists($targetDir); foreach ($sources as $i => $source) { + if (isset($e)) { + $this->io->write('Now trying to download from ' . $source . ''); + } $package->setInstallationSource($source); try { $downloader = $this->getDownloaderForInstalledPackage($package); @@ -204,9 +207,9 @@ class DownloadManager } $this->io->write( - 'Caught an exception while trying to download '. - $package->getPrettyString(). - ': '. + 'Failed to download '. + $package->getPrettyName(). + ' from ' . $source . ': '. $e->getMessage().'' ); } diff --git a/src/Composer/Downloader/TransportException.php b/src/Composer/Downloader/TransportException.php index d157dde3c..b28f8d470 100644 --- a/src/Composer/Downloader/TransportException.php +++ b/src/Composer/Downloader/TransportException.php @@ -15,7 +15,7 @@ namespace Composer\Downloader; /** * @author Jordi Boggiano */ -class TransportException extends \Exception +class TransportException extends \RuntimeException { protected $headers;