diff --git a/src/__phutil_library_map__.php b/src/__phutil_library_map__.php --- a/src/__phutil_library_map__.php +++ b/src/__phutil_library_map__.php @@ -123,6 +123,7 @@ 'ArcanistMercurialParserTestCase' => 'repository/parser/__tests__/ArcanistMercurialParserTestCase.php', 'ArcanistMergeConflictLinter' => 'lint/linter/ArcanistMergeConflictLinter.php', 'ArcanistMergeConflictLinterTestCase' => 'lint/linter/__tests__/ArcanistMergeConflictLinterTestCase.php', + 'ArcanistMissingLinterException' => 'lint/linter/ArcanistMissingLinterException.php', 'ArcanistNoEffectException' => 'exception/usage/ArcanistNoEffectException.php', 'ArcanistNoEngineException' => 'exception/usage/ArcanistNoEngineException.php', 'ArcanistNoLintLinter' => 'lint/linter/ArcanistNoLintLinter.php', @@ -306,6 +307,7 @@ 'ArcanistMercurialParserTestCase' => 'ArcanistTestCase', 'ArcanistMergeConflictLinter' => 'ArcanistLinter', 'ArcanistMergeConflictLinterTestCase' => 'ArcanistArcanistLinterTestCase', + 'ArcanistMissingLinterException' => 'ArcanistUsageException', 'ArcanistNoEffectException' => 'ArcanistUsageException', 'ArcanistNoEngineException' => 'ArcanistUsageException', 'ArcanistNoLintLinter' => 'ArcanistLinter', diff --git a/src/lint/linter/ArcanistExternalLinter.php b/src/lint/linter/ArcanistExternalLinter.php --- a/src/lint/linter/ArcanistExternalLinter.php +++ b/src/lint/linter/ArcanistExternalLinter.php @@ -265,7 +265,7 @@ if ($interpreter) { if (!Filesystem::binaryExists($interpreter)) { - throw new ArcanistUsageException( + throw new ArcanistMissingLinterException( pht( 'Unable to locate interpreter "%s" to run linter %s. You may '. 'need to install the interpreter, or adjust your linter '. @@ -276,7 +276,7 @@ $this->getInstallInstructions())); } if (!Filesystem::pathExists($binary)) { - throw new ArcanistUsageException( + throw new ArcanistMissingLinterException( pht( 'Unable to locate script "%s" to run linter %s. You may need '. 'to install the script, or adjust your linter configuration. '. @@ -287,7 +287,7 @@ } } else { if (!Filesystem::binaryExists($binary)) { - throw new ArcanistUsageException( + throw new ArcanistMissingLinterException( pht( 'Unable to locate binary "%s" to run linter %s. You may need '. 'to install the binary, or adjust your linter configuration. '. diff --git a/src/lint/linter/ArcanistJSHintLinter.php b/src/lint/linter/ArcanistJSHintLinter.php --- a/src/lint/linter/ArcanistJSHintLinter.php +++ b/src/lint/linter/ArcanistJSHintLinter.php @@ -148,7 +148,7 @@ if (!is_array($errors)) { // Something went wrong and we can't decode the output. Exit abnormally. - throw new ArcanistUsageException( + throw new RuntimeException( "JSHint returned unparseable output.\n". "stdout:\n\n{$stdout}". "stderr:\n\n{$stderr}"); diff --git a/src/lint/linter/ArcanistMissingLinterException.php b/src/lint/linter/ArcanistMissingLinterException.php new file mode 100644 --- /dev/null +++ b/src/lint/linter/ArcanistMissingLinterException.php @@ -0,0 +1,3 @@ +