You are here

protected function QuestionHelper::writeError in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/symfony/console/Helper/QuestionHelper.php \Symfony\Component\Console\Helper\QuestionHelper::writeError()

Outputs an error message.

Parameters

OutputInterface $output:

\Exception $error:

2 calls to QuestionHelper::writeError()
QuestionHelper::validateAttempts in vendor/symfony/console/Helper/QuestionHelper.php
Validates an attempt.
SymfonyQuestionHelper::writeError in vendor/symfony/console/Helper/SymfonyQuestionHelper.php
Outputs an error message.
1 method overrides QuestionHelper::writeError()
SymfonyQuestionHelper::writeError in vendor/symfony/console/Helper/SymfonyQuestionHelper.php
Outputs an error message.

File

vendor/symfony/console/Helper/QuestionHelper.php, line 186

Class

QuestionHelper
The QuestionHelper class provides helpers to interact with the user.

Namespace

Symfony\Component\Console\Helper

Code

protected function writeError(OutputInterface $output, \Exception $error) {
  if (null !== $this
    ->getHelperSet() && $this
    ->getHelperSet()
    ->has('formatter')) {
    $message = $this
      ->getHelperSet()
      ->get('formatter')
      ->formatBlock($error
      ->getMessage(), 'error');
  }
  else {
    $message = '<error>' . $error
      ->getMessage() . '</error>';
  }
  $output
    ->writeln($message);
}