3 namespace Drupal\libraries\Plugin;
5 use Drupal\Component\Plugin\Exception\PluginException;
8 * Provides an exception class for missing plugin configuration.
10 * The plugin system allows passing arbitrary data to plugins in form of the
11 * $configuration array. Some plugins, however, may depend on certain keys to
12 * be present in $configuration. This exception class can be used if such keys
15 * @todo Provide accessors for the passed-in information.
17 class MissingPluginConfigurationException extends PluginException {
20 * Constructs an exception for a missing plugin configuration value.
22 * @param string $plugin_id
24 * @param $plugin_definition
25 * The plugin definition
26 * @param array $configuration
27 * The plugin configuration.
29 * The missing key in the configuration.
30 * @param string $message
31 * (optional) The exception message.
33 * (optional) The error code.
34 * @param \Exception $previous
35 * (optional) The previous exception.
37 public function __construct(
44 \Exception $previous = NULL
46 $message = $message ?: "The '{$missing_key}' key is missing in the configuration of the '{$plugin_id}' plugin.";
47 parent::__construct($message, $code, $previous);