for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
declare(strict_types=1);
namespace Doctrine\DBAL\Driver;
/**
* Tiny wrapper for PDOException instances to implement the {@link DriverException} interface.
*/
class PDOException extends AbstractDriverException
{
* @param \PDOException $exception The PDO exception to wrap.
public function __construct(\PDOException $exception)
if ($exception->errorInfo !== null) {
[$sqlState, $code] = $exception->errorInfo;
} else {
$code = $exception->getCode();
$sqlState = null;
}
parent::__construct($exception->getMessage(), $sqlState, $code, $exception);