You are here

class UnknownLibraryVersionException in Libraries API 8.3

Provides an exception for libraries whose version has not been detected.

Hierarchy

Expanded class hierarchy of UnknownLibraryVersionException

4 files declare their use of UnknownLibraryVersionException
LinePatternDetector.php in src/Plugin/libraries/VersionDetector/LinePatternDetector.php
LinePatternDetectorTest.php in tests/src/Unit/Plugin/libraries/VersionDetector/LinePatternDetectorTest.php
StaticDetector.php in src/Plugin/libraries/VersionDetector/StaticDetector.php
VersionedLibraryTrait.php in src/ExternalLibrary/Version/VersionedLibraryTrait.php

File

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

Namespace

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

  /**
   * Constructs a library exception.
   *
   * @param \Drupal\libraries\ExternalLibrary\Version\VersionedLibraryInterface $library
   *   The library.
   * @param string $message
   *   (optional) The exception message.
   * @param int $code
   *   (optional) The error code.
   * @param \Exception $previous
   *   (optional) The previous exception.
   */
  public function __construct(VersionedLibraryInterface $library, $message = '', $code = 0, \Exception $previous = NULL) {
    $this->library = $library;
    $message = $message ?: "The version of library '{$this->library->getId()}' could not be detected.";
    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.
UnknownLibraryVersionException::__construct public function Constructs a library exception.