You are here

public function InvalidLibraryDependencyException::__construct in Libraries API 8.3

Constructs a library exception.

Parameters

\Drupal\libraries\ExternalLibrary\LibraryInterface $library: The library with the invalid dependency.

\Drupal\libraries\ExternalLibrary\LibraryInterface $dependency: The dependency.

string $message: (optional) The exception message.

int $code: (optional) The error code.

\Exception $previous: (optional) The previous exception.

File

src/ExternalLibrary/Exception/InvalidLibraryDependencyException.php, line 34

Class

InvalidLibraryDependencyException
Provides an exception for an invalid library exception.

Namespace

Drupal\libraries\ExternalLibrary\Exception

Code

public function __construct(LibraryInterface $library, LibraryInterface $dependency, $message = '', $code = 0, \Exception $previous = NULL) {
  $this->library = $library;
  $this->dependency = $dependency;
  $message = $message ?: "The library '{$this->library->getId()}' cannot depend on the library '{$this->dependency->getId()}'.";
  parent::__construct($message, $code, $previous);
}