You are here

class LibraryNotInstalledException in Libraries API 8.3

Provides an exception for a library that is not installed.

Hierarchy

Expanded class hierarchy of LibraryNotInstalledException

4 files declare their use of LibraryNotInstalledException
AssetLibrary.php in src/ExternalLibrary/Asset/AssetLibrary.php
LocalLibraryTrait.php in src/ExternalLibrary/Local/LocalLibraryTrait.php
MultipleAssetLibrary.php in src/ExternalLibrary/Asset/MultipleAssetLibrary.php
PhpFileLibrary.php in src/ExternalLibrary/PhpFile/PhpFileLibrary.php

File

src/ExternalLibrary/Exception/LibraryNotInstalledException.php, line 12

Namespace

Drupal\libraries\ExternalLibrary\Exception
View source
class LibraryNotInstalledException extends \RuntimeException implements LibraryAccessorInterface {
  use LibraryAccessorTrait;

  /**
   * Constructs a library exception.
   *
   * @param \Drupal\libraries\ExternalLibrary\Local\LocalLibraryInterface $library
   *   The library that is not installed.
   * @param string $message
   *   (optional) The exception message.
   * @param int $code
   *   (optional) The error code.
   * @param \Exception $previous
   *   (optional) The previous exception.
   */
  public function __construct(LocalLibraryInterface $library, $message = '', $code = 0, \Exception $previous = NULL) {
    $this->library = $library;
    $message = $message ?: "The library '{$this->library->getId()}' is not installed.";
    parent::__construct($message, $code, $previous);
  }

}

Members

Namesort descending Modifiers Type Description Overrides
LibraryAccessorTrait::$library protected property The library.
LibraryAccessorTrait::getLibrary public function Returns the library.
LibraryNotInstalledException::__construct public function Constructs a library exception.