Index: support/ArcanistRuntime.php =================================================================== --- support/ArcanistRuntime.php +++ support/ArcanistRuntime.php @@ -3,9 +3,14 @@ final class ArcanistRuntime { public function execute(array $argv) { - $err = $this->checkEnvironment(); - if ($err) { - return $err; + + try { + $this->checkEnvironment(); + } catch (Exception $ex) { + echo "CONFIGURATION ERROR\n\n"; + echo $ex->getMessage(); + echo "\n\n"; + return 1; } PhutilTranslator::getInstance() @@ -109,7 +114,8 @@ 'minimum supported version ("%s"). Update PHP to continue.', $cur_version, $min_version); - return $this->fatalError($message); + + throw new Exception($message); } if ($is_windows) { @@ -190,17 +196,9 @@ $problems[] = "PHP was built with this configure command:\n\n{$config}"; } $problems = implode("\n\n", $problems); - return $this->fatalError($problems); - } - return 0; - } - - private function fatalError($message) { - echo "CONFIGURATION ERROR\n\n"; - echo $message; - echo "\n\n"; - return 1; + throw new Exception($problems); + } } private function loadConfiguration(PhutilArgumentParser $args) {