src/Connection.php
protected static function wrapException(
        \Throwable $exception,
        string $query = null,
        array $values = null
    ): \Throwable {
        if ($exception instanceof BasePDOException) {
            return PDOException::wrapBaseException($exception, $query, $values);
        }

        return $exception;
    }
protected static function wrapException(
        \Throwable $exception,
        string $query = null,
        array $values = null
    ): \Throwable {
        if ($exception instanceof BasePDOException) {
            return PDOException::wrapBaseException($exception, $query, $values);
        }

        return $exception;
    }
protected static function wrapException ( \ Throwable $ exception , string $ query = null , array $ values = null ) : \ Throwable { if ( $ exception instanceof BasePDOException ) { return PDOException :: wrapBaseException ( $ exception , $ query , $ values ) ; } return $ exception ; }
Creates a library exception from a PHP exception if possible.

@param \Throwable $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 IException|\Throwable
Creates a library exception from a PHP exception if possible .