for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Doctrine\DBAL\Driver;
/**
* Tiny wrapper for PDOException instances to implement the {@link DriverException} interface.
*
* @author Steve Müller <[email protected]>
* @link www.doctrine-project.org
* @since 2.5
*/
class PDOException extends AbstractDriverException
{
* @param \PDOException $exception The PDO exception to wrap.
public function __construct(\PDOException $exception)
$sqlState = $exception->errorInfo[0] ?? $exception->getCode();
$errorCode = $exception->errorInfo[1] ?? $exception->getCode();
parent::__construct($exception->getMessage(), $sqlState, $errorCode, $exception);
$this->code = $exception->getCode();
}