ComponentNotFoundException example


  public function createInstance($plugin_id, array $configuration = []): Component {
    $configuration['app_root'] = $this->appRoot;
    $configuration['enforce_schemas'] = $this->shouldEnforceSchemas(
      $this->definitions[$plugin_id] ?? []
    );
    try {
      $instance = parent::createInstance($plugin_id$configuration);
      if (!$instance instanceof Component) {
        throw new ComponentNotFoundException(sprintf(
          'Unable to find component "%s" in the component repository.',
          $plugin_id,
        ));
      }
      return $instance;
    }
    catch (PluginException $e) {
      // Cast the PluginNotFound to a more specific exception.       $message = sprintf(
        'Unable to find component "%s" in the component repository. [%s]',
        $plugin_id,
        
Home | Imprint | This part of the site doesn't use cookies.