You are here

protected function ParserBase::printErrors in Feeds extensible parsers 8

Prints errors to the screen.

Parameters

array $errors: A list of errors as returned by stopErrorHandling().

int $severity: (optional) Limit to only errors of the specified severity. Defaults to RfcLogLevel::ERROR.

See also

watchdog()

1 call to ParserBase::printErrors()
ParserBase::parse in src/Feeds/Parser/ParserBase.php
Parses content returned by fetcher.

File

src/Feeds/Parser/ParserBase.php, line 390

Class

ParserBase
The Feeds extensible parser.

Namespace

Drupal\feeds_ex\Feeds\Parser

Code

protected function printErrors(array $errors, $severity = RfcLogLevel::ERROR) {
  foreach ($errors as $error) {
    if ($error['severity'] > $severity) {
      continue;
    }
    $this
      ->getMessenger()
      ->addMessage($this
      ->t($error['message'], $error['variables']), $error['severity'] <= RfcLogLevel::ERROR ? 'error' : 'warning', FALSE);
  }
}