Security update for Core, with self-updated composer
[yaffs-website] / web / core / lib / Drupal / Core / Installer / Exception / InstallerException.php
1 <?php
2
3 namespace Drupal\Core\Installer\Exception;
4
5 use Drupal\Core\StringTranslation\StringTranslationTrait;
6
7 /**
8  * Base class for exceptions thrown by installer.
9  */
10 class InstallerException extends \RuntimeException {
11   use StringTranslationTrait;
12
13   /**
14    * The page title to output.
15    *
16    * @var string
17    */
18   protected $title;
19
20   /**
21    * Constructs a new installer exception.
22    *
23    * @param string $message
24    *   The exception message.
25    * @param string $title
26    *   (optional) The page title. Defaults to 'Error'.
27    * @param int $code
28    *   (optional) The exception code. Defaults to 0.
29    * @param \Exception $previous
30    *   (optional) A previous exception.
31    */
32   public function __construct($message, $title = 'Error', $code = 0, \Exception $previous = NULL) {
33     parent::__construct($message, $code, $previous);
34     $this->title = $title;
35   }
36
37   /**
38    * Returns the exception page title.
39    *
40    * @return string
41    */
42   public function getTitle() {
43     return $this->title;
44   }
45
46 }