Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Commit

Permalink
Send arcanist error output to STDERR
Browse files Browse the repository at this point in the history
Summary: Currently, arcanist error output is sent to `STDOUT` instead of `STDOUT`. This is annoying because I am running `arc lint --everything --never-apply-patches --output=xml > checkstyle.xml` and the `checkstyle.xml` file is not valid XML.

Test Plan: Forced a linter to throw an exception and ran `arc lint >/dev/null`... saw error output.

Reviewers: #blessed_reviewers, epriestley

Reviewed By: #blessed_reviewers, epriestley

Subscribers: Korvin, epriestley

Differential Revision: https://secure.phabricator.com/D13043
  • Loading branch information
joshuaspence committed May 27, 2015
1 parent 3ac8020 commit 2924ebb
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions scripts/arcanist.php
Expand Up @@ -394,26 +394,26 @@
} catch (Exception $ex) {
$is_usage = ($ex instanceof ArcanistUsageException);
if ($is_usage) {
echo phutil_console_format(
fwrite(STDERR, phutil_console_format(
"**%s** %s\n",
pht('Usage Exception:'),
$ex->getMessage());
$ex->getMessage()));
}

if ($config) {
$config->didAbortWorkflow($command, $workflow, $ex);
}

if ($config_trace_mode) {
echo "\n";
fwrite(STDERR, "\n");
throw $ex;
}

if (!$is_usage) {
echo phutil_console_format("**%s**\n", pht('Exception'));
fwrite(STDERR, phutil_console_format("**%s**\n", pht('Exception')));

while ($ex) {
echo $ex->getMessage()."\n";
fwrite(STDERR, $ex->getMessage()."\n");

if ($ex instanceof PhutilProxyException) {
$ex = $ex->getPreviousException();
Expand All @@ -422,9 +422,9 @@
}
}

echo phutil_console_format(
echo fwrite(STDERR, phutil_console_format(
"(%s)\n",
pht('Run with `%s` for a full exception trace.', '--trace'));
pht('Run with `%s` for a full exception trace.', '--trace')));
}

exit(1);
Expand Down

0 comments on commit 2924ebb

Please sign in to comment.