for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
declare(strict_types=1);
namespace Doctrine\DBAL\Exception;
use Doctrine\DBAL\DBALException;
use Doctrine\DBAL\Driver\DriverException as DriverExceptionInterface;
use Exception;
/**
* Base class for all errors detected in the driver.
*/
class DriverException extends DBALException implements DriverExceptionInterface
{
* The previous DBAL driver exception.
*
* @var DriverExceptionInterface
private $driverException;
* @param string $message The exception message.
* @param DriverExceptionInterface $driverException The DBAL driver exception to chain.
public function __construct(string $message, DriverExceptionInterface $driverException)
$exception = null;
$code = 0;
if ($driverException instanceof Exception) {
$exception = $driverException;
$code = $driverException->getCode();
}
parent::__construct($message, $code, $exception);
$this->driverException = $driverException;
* Returns the SQLSTATE the driver was in at the time the error occurred, if given.
* Returns null if no SQLSTATE was given by the driver.
public function getSQLState() : ?string
return $this->driverException->getSQLState();