3 namespace Drupal\libraries\ExternalLibrary\Exception;
5 use Drupal\libraries\ExternalLibrary\Utility\LibraryIdAccessorTrait;
6 use Drupal\libraries\ExternalLibrary\Utility\LibraryIdAccessorInterface;
9 * Provides an exception for a library definition without a type declaration.
11 class LibraryTypeNotFoundException extends \RuntimeException implements LibraryAccessorInterface {
13 use LibraryIdAccessorTrait;
16 * Constructs a library exception.
18 * @param string $library_id
20 * @param string $message
21 * (optional) The exception message.
23 * (optional) The error code.
24 * @param \Exception $previous
25 * (optional) The previous exception.
27 public function __construct(
31 \Exception $previous = NULL
33 $this->libraryId = (string) $library_id;
34 $message = $message ?: "The library type for the library '{$this->libraryId}' could not be found.";
35 parent::__construct($message, $code, $previous);