diff --git a/src/Composer/Console/Application.php b/src/Composer/Console/Application.php index 9f0753eb7..d5f69697b 100644 --- a/src/Composer/Console/Application.php +++ b/src/Composer/Console/Application.php @@ -33,6 +33,7 @@ use Composer\Util\ErrorHandler; use Composer\Util\HttpDownloader; use Composer\EventDispatcher\ScriptExecutionException; use Composer\Exception\NoSslException; +use Symfony\Component\Process\Exception\ProcessTimedOutException; /** * The console application that handles the commands @@ -385,6 +386,11 @@ class Application extends BaseApplication $io->writeError('Check https://getcomposer.org/doc/articles/troubleshooting.md#proc-open-fork-failed-errors for details', true, IOInterface::QUIET); } + if ($exception instanceof ProcessTimedOutException) { + $io->writeError('The following exception is caused by a process timeout', true, IOInterface::QUIET); + $io->writeError('Check https://getcomposer.org/doc/06-config.md#process-timeout for details', true, IOInterface::QUIET); + } + if ($hints = HttpDownloader::getExceptionHints($exception)) { foreach ($hints as $hint) { $io->writeError($hint, true, IOInterface::QUIET); diff --git a/src/Composer/Util/ProcessExecutor.php b/src/Composer/Util/ProcessExecutor.php index f795a8d52..5ba2e57eb 100644 --- a/src/Composer/Util/ProcessExecutor.php +++ b/src/Composer/Util/ProcessExecutor.php @@ -367,11 +367,17 @@ class ProcessExecutor } } + /** + * @return int the timeout in seconds + */ public static function getTimeout() { return static::$timeout; } + /** + * @param int $timeout the timeout in seconds + */ public static function setTimeout($timeout) { static::$timeout = $timeout;