function ProviderException::__construct

Same name in other branches
  1. 8.9.x core/modules/media/src/OEmbed/ProviderException.php \Drupal\media\OEmbed\ProviderException::__construct()
  2. 10 core/modules/media/src/OEmbed/ProviderException.php \Drupal\media\OEmbed\ProviderException::__construct()
  3. 11.x core/modules/media/src/OEmbed/ProviderException.php \Drupal\media\OEmbed\ProviderException::__construct()

ProviderException constructor.

Parameters

string $message: The exception message. '@name' will be replaced with the provider name if available, or '<unknown>' if not.

\Drupal\media\OEmbed\Provider $provider: (optional) The provider information.

\Exception $previous: (optional) The previous exception, if any.

File

core/modules/media/src/OEmbed/ProviderException.php, line 34

Class

ProviderException
Exception thrown if an oEmbed provider causes an error.

Namespace

Drupal\media\OEmbed

Code

public function __construct($message, Provider $provider = NULL, \Exception $previous = NULL) {
    $this->provider = $provider;
    $message = str_replace('@name', $provider ? $provider->getName() : '<unknown>', $message);
    parent::__construct($message, 0, $previous);
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.