function PluginNotFoundException::__construct

Same name in other branches
  1. 8.9.x core/lib/Drupal/Component/Plugin/Exception/PluginNotFoundException.php \Drupal\Component\Plugin\Exception\PluginNotFoundException::__construct()
  2. 10 core/lib/Drupal/Component/Plugin/Exception/PluginNotFoundException.php \Drupal\Component\Plugin\Exception\PluginNotFoundException::__construct()
  3. 11.x core/lib/Drupal/Component/Plugin/Exception/PluginNotFoundException.php \Drupal\Component\Plugin\Exception\PluginNotFoundException::__construct()

Construct a PluginNotFoundException exception.

Parameters

string $plugin_id: The plugin ID that was not found.

string $message: The exception message.

int $code: The exception code.

\Exception|null $previous: The previous throwable used for exception chaining.

See also

\Exception

File

core/lib/Drupal/Component/Plugin/Exception/PluginNotFoundException.php, line 24

Class

PluginNotFoundException
Plugin exception class to be thrown when a plugin ID could not be found.

Namespace

Drupal\Component\Plugin\Exception

Code

public function __construct($plugin_id, $message = '', $code = 0, \Exception $previous = NULL) {
    if (empty($message)) {
        $message = sprintf("Plugin ID '%s' was not found.", $plugin_id);
    }
    parent::__construct($message, $code, $previous);
}

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