Security update for permissions_by_term
[yaffs-website] / vendor / drupal / drupal-driver / src / Drupal / Driver / Exception / Exception.php
1 <?php
2
3 namespace Drupal\Driver\Exception;
4
5 use Drupal\Driver\DriverInterface;
6
7 /**
8  * Drupal driver manager base exception class.
9  */
10 abstract class Exception extends \Exception {
11   private $driver;
12
13   /**
14    * Initializes Drupal driver manager exception.
15    *
16    * @param string $message
17    *   The exception message.
18    * @param DriverInterface $driver
19    *   The driver where the exception occurred.
20    * @param int $code
21    *   Optional exception code. Defaults to 0.
22    * @param \Exception $previous
23    *   Optional previous exception that was thrown.
24    */
25   public function __construct($message, DriverInterface $driver = NULL, $code = 0, \Exception $previous = NULL) {
26     $this->driver = $driver;
27
28     parent::__construct($message, $code, $previous);
29   }
30
31   /**
32    * Returns exception session.
33    *
34    * @return Session
35    *   The exception session.
36    */
37   public function getDriver() {
38     return $this->driver;
39   }
40
41 }