1
0
Fork 0

Added link to composer.org docs on ProcessTimedOutException (#9796)

pull/9832/head
Markus Staab 2021-04-11 13:30:35 +02:00 committed by GitHub
parent d75d79b452
commit 7c602d8807
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 0 deletions

View File

@ -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('<error>Check https://getcomposer.org/doc/articles/troubleshooting.md#proc-open-fork-failed-errors for details</error>', true, IOInterface::QUIET);
}
if ($exception instanceof ProcessTimedOutException) {
$io->writeError('<error>The following exception is caused by a process timeout</error>', true, IOInterface::QUIET);
$io->writeError('<error>Check https://getcomposer.org/doc/06-config.md#process-timeout for details</error>', true, IOInterface::QUIET);
}
if ($hints = HttpDownloader::getExceptionHints($exception)) {
foreach ($hints as $hint) {
$io->writeError($hint, true, IOInterface::QUIET);

View File

@ -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;