function public function ProviderBase::trackCdnExceptions

8.x-3.x ProviderBase.php public ProviderBase::trackCdnExceptions(callable $callable)

Tracks any newly generated CDN exceptions generated during a callable.

Parameters

callable $callable: The callback to execute.

Return value

\Drupal\bootstrap\Plugin\Provider\ProviderException[] An array of newly generated ProviderException objects, if any.

Overrides ProviderInterface::trackCdnExceptions

Class

ProviderBase
CDN Provider base class.

Namespace

Drupal\bootstrap\Plugin\Provider

Source src/Plugin/Provider/ProviderBase.php (line 571)

public function trackCdnExceptions(callable $callable) {
  // Retrieve existing exceptions.
  $existing = $this->getCdnExceptions();

  // Execute the callable.
  $callable($this);

  // Retrieve any newly generated exceptions.
  $new = $this->getCdnExceptions();

  // Merge the existing and newly generated exceptions and set them.
  $this->setCdnExceptions(array_merge($existing, $new));

  // Return the newly generated exceptions.
  return $new;
}