Version 1
[yaffs-website] / web / core / lib / Drupal / Component / Plugin / Exception / PluginNotFoundException.php
1 <?php
2
3 namespace Drupal\Component\Plugin\Exception;
4
5 /**
6  * Plugin exception class to be thrown when a plugin ID could not be found.
7  */
8 class PluginNotFoundException extends PluginException {
9
10   /**
11    * Construct an PluginNotFoundException exception.
12    *
13    * For the remaining parameters see \Exception.
14    *
15    * @param string $plugin_id
16    *   The plugin ID that was not found.
17    *
18    * @see \Exception
19    */
20   public function __construct($plugin_id, $message = '', $code = 0, \Exception $previous = NULL) {
21     if (empty($message)) {
22       $message = sprintf("Plugin ID '%s' was not found.", $plugin_id);
23     }
24     parent::__construct($message, $code, $previous);
25   }
26
27 }