You are here

private function SitemapWarmer::parseSitemap in Warmer 8

Same name and namespace in other branches
  1. 2.x modules/warmer_cdn/src/Plugin/warmer/SitemapWarmer.php \Drupal\warmer_cdn\Plugin\warmer\SitemapWarmer::parseSitemap()

Parses a sitemap and logs exceptions.

Parameters

string $location: The fully loaded URL for the sitemap.

File

modules/warmer_cdn/src/Plugin/warmer/SitemapWarmer.php, line 219

Class

SitemapWarmer
The cache warmer for the built-in entity cache.

Namespace

Drupal\warmer_cdn\Plugin\warmer

Code

private function parseSitemap($location) {
  try {
    $this->sitemapParser
      ->parseRecursive($location);
  } catch (SitemapParserException $exception) {
    watchdog_exception('warmer_cdn', $exception);
    $message = $this
      ->t('There was an error parsing the Sitemap in %location. Please check the watchdog logs for more information.', [
      '%location' => $location,
    ]);
    $this
      ->messenger()
      ->addError($message);
  }
}