class PluginNotFoundException

Same name and namespace in other branches
  1. 9 core/lib/Drupal/Component/Plugin/Exception/PluginNotFoundException.php \Drupal\Component\Plugin\Exception\PluginNotFoundException
  2. 8.9.x core/lib/Drupal/Component/Plugin/Exception/PluginNotFoundException.php \Drupal\Component\Plugin\Exception\PluginNotFoundException
  3. 11.x core/lib/Drupal/Component/Plugin/Exception/PluginNotFoundException.php \Drupal\Component\Plugin\Exception\PluginNotFoundException

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

Hierarchy

Expanded class hierarchy of PluginNotFoundException

55 files declare their use of PluginNotFoundException
Action.php in core/modules/system/src/Entity/Action.php
AddModerationConfigActionTest.php in core/modules/content_moderation/tests/src/Kernel/ConfigAction/AddModerationConfigActionTest.php
AddToAllBundlesConfigActionTest.php in core/modules/field/tests/src/Kernel/AddToAllBundlesConfigActionTest.php
ConfigActionManager.php in core/lib/Drupal/Core/Config/Action/ConfigActionManager.php
ConfigActionTest.php in core/tests/Drupal/KernelTests/Core/Config/Action/ConfigActionTest.php

... See full list

File

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

Namespace

Drupal\Component\Plugin\Exception
View source
class PluginNotFoundException extends PluginException {
  
  /**
   * Construct a PluginNotFoundException exception.
   *
   * @param string $plugin_id
   *   The plugin ID that was not found.
   * @param string $message
   *   The exception message.
   * @param int $code
   *   The exception code.
   * @param \Exception|null $previous
   *   The previous throwable used for exception chaining.
   *
   * @see \Exception
   */
  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);
  }

}

Members

Title Sort descending Modifiers Object type Summary
PluginNotFoundException::__construct public function Construct a PluginNotFoundException exception.

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