Remove override of renderException, refs #4774
parent
03299ff075
commit
2491679ba3
|
@ -103,9 +103,8 @@ class Application extends BaseApplication
|
|||
*/
|
||||
public function doRun(InputInterface $input, OutputInterface $output)
|
||||
{
|
||||
$this->io = new ConsoleIO($input, $output, $this->getHelperSet());
|
||||
ErrorHandler::register($this->io);
|
||||
$io = $this->getIO();
|
||||
$io = $this->io = new ConsoleIO($input, $output, $this->getHelperSet());
|
||||
ErrorHandler::register($io);
|
||||
|
||||
// determine command name to be executed
|
||||
$commandName = '';
|
||||
|
@ -128,7 +127,6 @@ class Application extends BaseApplication
|
|||
if (defined('COMPOSER_DEV_WARNING_TIME') && $commandName !== 'self-update' && $commandName !== 'selfupdate' && time() > COMPOSER_DEV_WARNING_TIME) {
|
||||
$io->writeError(sprintf('<warning>Warning: This development build of composer is over 60 days old. It is recommended to update it by running "%s self-update" to get the latest version.</warning>', $_SERVER['PHP_SELF']));
|
||||
}
|
||||
}
|
||||
|
||||
if (getenv('COMPOSER_NO_INTERACTION')) {
|
||||
$input->setInteractive(false);
|
||||
|
@ -158,7 +156,9 @@ class Application extends BaseApplication
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
try {
|
||||
if ($input->hasParameterOption('--profile')) {
|
||||
$startTime = microtime(true);
|
||||
$this->io->enableDebugging($startTime);
|
||||
|
@ -175,6 +175,10 @@ class Application extends BaseApplication
|
|||
}
|
||||
|
||||
return $result;
|
||||
} catch (\Exception $e) {
|
||||
$this->hintCommonErrors($e);
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -195,7 +199,7 @@ class Application extends BaseApplication
|
|||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public function renderException($exception, $output)
|
||||
private function hintCommonErrors($exception)
|
||||
{
|
||||
$io = $this->getIO();
|
||||
|
||||
|
@ -224,12 +228,6 @@ class Application extends BaseApplication
|
|||
$io->writeError('<error>The following exception is caused by a lack of memory and not having swap configured</error>');
|
||||
$io->writeError('<error>Check https://getcomposer.org/doc/articles/troubleshooting.md#proc-open-fork-failed-errors for details</error>');
|
||||
}
|
||||
|
||||
if ($output instanceof ConsoleOutputInterface) {
|
||||
parent::renderException($exception, $output->getErrorOutput());
|
||||
} else {
|
||||
parent::renderException($exception, $output);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue