You are here

public function ProviderException::__construct in Drupal 9

Same name and namespace in other branches
  1. 8 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()

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);
}