Skip to content

Commit

Permalink
Use STDERR for Command error
Browse files Browse the repository at this point in the history
  • Loading branch information
g105b committed Nov 21, 2018
1 parent ce745a8 commit 54316be
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/Command/ValidateCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@

use Gt\Cli\Argument\ArgumentValueList;
use Gt\Cli\Command\Command;
use Gt\Cli\Stream;
use Gt\Cron\CronException;
use Gt\Cron\RunnerFactory;
use InvalidArgumentException;

class ValidateCommand extends Command {
public function __construct() {
Expand All @@ -18,8 +19,11 @@ public function run(ArgumentValueList $arguments):void {
getcwd()
);
}
catch(InvalidArgumentException $exception) {
echo $exception->getMessage();
catch(CronException $exception) {
$this->stream->writeLine(
$exception->getMessage(),
Stream::ERROR
);
exit(1);
}

Expand Down

0 comments on commit 54316be

Please sign in to comment.