summaryrefslogtreecommitdiff
path: root/vendor/doctrine/dbal/src/Driver/AbstractException.php
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/doctrine/dbal/src/Driver/AbstractException.php')
-rw-r--r--vendor/doctrine/dbal/src/Driver/AbstractException.php36
1 files changed, 36 insertions, 0 deletions
diff --git a/vendor/doctrine/dbal/src/Driver/AbstractException.php b/vendor/doctrine/dbal/src/Driver/AbstractException.php
new file mode 100644
index 0000000..367fc49
--- /dev/null
+++ b/vendor/doctrine/dbal/src/Driver/AbstractException.php
@@ -0,0 +1,36 @@
1<?php
2
3declare(strict_types=1);
4
5namespace Doctrine\DBAL\Driver;
6
7use Exception as BaseException;
8use Throwable;
9
10/**
11 * Abstract base implementation of the {@see DriverException} interface.
12 *
13 * @psalm-immutable
14 */
15abstract class AbstractException extends BaseException implements Exception
16{
17 /**
18 * @param string $message The driver error message.
19 * @param string|null $sqlState The SQLSTATE the driver is in at the time the error occurred, if any.
20 * @param int $code The driver specific error code if any.
21 * @param Throwable|null $previous The previous throwable used for the exception chaining.
22 */
23 public function __construct(
24 string $message,
25 private readonly ?string $sqlState = null,
26 int $code = 0,
27 ?Throwable $previous = null,
28 ) {
29 parent::__construct($message, $code, $previous);
30 }
31
32 public function getSQLState(): ?string
33 {
34 return $this->sqlState;
35 }
36}