Subversion-Projekte lars-tiefland.laravel_shop

Revision

Details | Letzte Änderung | Log anzeigen | RSS feed

Revision Autor Zeilennr. Zeile
148 lars 1
<?php
2
 
3
declare(strict_types=1);
4
 
5
namespace Doctrine\DBAL\Driver;
6
 
7
use Exception as BaseException;
8
use Throwable;
9
 
10
/**
11
 * Base implementation of the {@see Exception} interface.
12
 *
13
 * @internal
14
 *
15
 * @psalm-immutable
16
 */
17
abstract class AbstractException extends BaseException implements Exception
18
{
19
    /**
20
     * The SQLSTATE of the driver.
21
     */
22
    private ?string $sqlState = null;
23
 
24
    /**
25
     * @param string         $message  The driver error message.
26
     * @param string|null    $sqlState The SQLSTATE the driver is in at the time the error occurred, if any.
27
     * @param int            $code     The driver specific error code if any.
28
     * @param Throwable|null $previous The previous throwable used for the exception chaining.
29
     */
30
    public function __construct($message, $sqlState = null, $code = 0, ?Throwable $previous = null)
31
    {
32
        parent::__construct($message, $code, $previous);
33
 
34
        $this->sqlState = $sqlState;
35
    }
36
 
37
    /**
38
     * {@inheritdoc}
39
     */
40
    public function getSQLState()
41
    {
42
        return $this->sqlState;
43
    }
44
}