diff --git a/src/Composer/ComposerOrchestrator.php b/src/Composer/ComposerOrchestrator.php index c12b59cf7..7fd0a2544 100644 --- a/src/Composer/ComposerOrchestrator.php +++ b/src/Composer/ComposerOrchestrator.php @@ -86,11 +86,7 @@ public static function getVersion( $getVersionProcess->run(null, self::getDefaultEnvVars()); if (false === $getVersionProcess->isSuccessful()) { - throw new RuntimeException( - 'Could not determine the Composer version.', - 0, - new ProcessFailedException($getVersionProcess), - ); + throw new ProcessFailedException($getVersionProcess); } $output = $getVersionProcess->getOutput(); @@ -99,7 +95,12 @@ public static function getVersion( return $match[1]; } - throw new RuntimeException('Could not determine the Composer version.'); + throw new RuntimeException( + sprintf( + 'Could not determine the Composer version from "%s".', + $output, + ), + ); } public static function dumpAutoload(