Security update for permissions_by_term
[yaffs-website] / vendor / drupal / drupal-driver / src / Drupal / Driver / Exception / Exception.php
diff --git a/vendor/drupal/drupal-driver/src/Drupal/Driver/Exception/Exception.php b/vendor/drupal/drupal-driver/src/Drupal/Driver/Exception/Exception.php
new file mode 100644 (file)
index 0000000..b8b76a8
--- /dev/null
@@ -0,0 +1,41 @@
+<?php
+
+namespace Drupal\Driver\Exception;
+
+use Drupal\Driver\DriverInterface;
+
+/**
+ * Drupal driver manager base exception class.
+ */
+abstract class Exception extends \Exception {
+  private $driver;
+
+  /**
+   * Initializes Drupal driver manager exception.
+   *
+   * @param string $message
+   *   The exception message.
+   * @param DriverInterface $driver
+   *   The driver where the exception occurred.
+   * @param int $code
+   *   Optional exception code. Defaults to 0.
+   * @param \Exception $previous
+   *   Optional previous exception that was thrown.
+   */
+  public function __construct($message, DriverInterface $driver = NULL, $code = 0, \Exception $previous = NULL) {
+    $this->driver = $driver;
+
+    parent::__construct($message, $code, $previous);
+  }
+
+  /**
+   * Returns exception session.
+   *
+   * @return Session
+   *   The exception session.
+   */
+  public function getDriver() {
+    return $this->driver;
+  }
+
+}