class LibraryNotInstalledException in Libraries API 8.3
Provides an exception for a library that is not installed.
Hierarchy
- class \Drupal\libraries\ExternalLibrary\Exception\LibraryNotInstalledException extends \Drupal\libraries\ExternalLibrary\Exception\RuntimeException implements LibraryAccessorInterface uses LibraryAccessorTrait
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\ExceptionView 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
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
LibraryAccessorTrait:: |
protected | property | The library. | |
LibraryAccessorTrait:: |
public | function | Returns the library. | |
LibraryNotInstalledException:: |
public | function | Constructs a library exception. |