summaryrefslogtreecommitdiffstats
path: root/core/modules/aggregator/src/Plugin/aggregator/parser/DefaultParser.php
diff options
context:
space:
mode:
Diffstat (limited to 'core/modules/aggregator/src/Plugin/aggregator/parser/DefaultParser.php')
-rw-r--r--core/modules/aggregator/src/Plugin/aggregator/parser/DefaultParser.php5
1 files changed, 4 insertions, 1 deletions
diff --git a/core/modules/aggregator/src/Plugin/aggregator/parser/DefaultParser.php b/core/modules/aggregator/src/Plugin/aggregator/parser/DefaultParser.php
index 03fa55f..2694042 100644
--- a/core/modules/aggregator/src/Plugin/aggregator/parser/DefaultParser.php
+++ b/core/modules/aggregator/src/Plugin/aggregator/parser/DefaultParser.php
@@ -4,6 +4,7 @@ namespace Drupal\aggregator\Plugin\aggregator\parser;
use Drupal\aggregator\Plugin\ParserInterface;
use Drupal\aggregator\FeedInterface;
+use Drupal\Core\Messenger\MessengerTrait;
use Zend\Feed\Reader\Reader;
use Zend\Feed\Reader\Exception\ExceptionInterface;
@@ -20,6 +21,8 @@ use Zend\Feed\Reader\Exception\ExceptionInterface;
*/
class DefaultParser implements ParserInterface {
+ use MessengerTrait;
+
/**
* {@inheritdoc}
*/
@@ -31,7 +34,7 @@ class DefaultParser implements ParserInterface {
}
catch (ExceptionInterface $e) {
watchdog_exception('aggregator', $e);
- drupal_set_message(t('The feed from %site seems to be broken because of error "%error".', ['%site' => $feed->label(), '%error' => $e->getMessage()]), 'error');
+ $this->messenger()->addError(t('The feed from %site seems to be broken because of error "%error".', ['%site' => $feed->label(), '%error' => $e->getMessage()]));
return FALSE;
}