src/Exceptions/PDOException.php
public static function wrapBaseException(BasePDOException $exception, string $query = null, array $values = null)
    {
        $newException = new static($exception->getMessage(), $exception->getCode(), $exception, $query, $values);
        $newException->errorInfo = $exception->errorInfo;
        return $newException;
    }
public static function wrapBaseException(BasePDOException $exception, string $query = null, array $values = null)
    {
        $newException = new static($exception->getMessage(), $exception->getCode(), $exception, $query, $values);
        $newException->errorInfo = $exception->errorInfo;
        return $newException;
    }
public static function wrapBaseException ( BasePDOException $ exception , string $ query = null , array $ values = null ) { $ newException = new static ( $ exception -> getMessage ( ) , $ exception -> getCode ( ) , $ exception , $ query , $ values ) ; $ newException -> errorInfo = $ exception -> errorInfo ; return $ newException ; }
Makes a self instance based on a base PDOException instance.

@param BasePDOException $exception Original exception
@param string|null $query SQL query which caused the error (if caused by a query)
@param array|null $values Bound values (if caused by a query)
@return self
Makes a self instance based on a base PDOException instance .