From aec1af4e11ec62f6842dc21bf0f35e25b6d3e9e4 Mon Sep 17 00:00:00 2001 From: Jordi Boggiano Date: Sat, 13 Dec 2014 11:47:22 +0000 Subject: [PATCH] Point users at troubleshooting if they get known exceptions --- src/Composer/Console/Application.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/Composer/Console/Application.php b/src/Composer/Console/Application.php index 940864683..849884d1c 100644 --- a/src/Composer/Console/Application.php +++ b/src/Composer/Console/Application.php @@ -191,6 +191,16 @@ class Application extends BaseApplication } catch (\Exception $e) { } + if (defined('PHP_WINDOWS_VERSION_BUILD') && false !== strpos($exception->getMessage(), 'The system cannot find the path specified')) { + $output->writeln('The following exception may be caused by a stale entry in your cmd.exe AutoRun'); + $output->writeln('Check https://getcomposer.org/doc/articles/troubleshooting.md#-the-system-cannot-find-the-path-specified-windows- for details'); + } + + if (false !== strpos($exception->getMessage(), 'fork failed - Cannot allocate memory')) { + $output->writeln('The following exception is caused by a lack of memory and not having swap configured'); + $output->writeln('Check https://getcomposer.org/doc/articles/troubleshooting.md#proc-open-fork-failed-errors for details'); + } + return parent::renderException($exception, $output); }