cakephp2-php8/lib/Cake/Model/Datasource/PDOExceptionWithQueryString.php
Kamil Wylegala cb3382f6d2
Some checks failed
PHP Coding Standard / phpcs (7.4) (push) Has been cancelled
Tests / linux-tests (mysql, 8.0) (push) Has been cancelled
Tests / linux-tests (mysql, 8.1) (push) Has been cancelled
Tests / linux-tests (pgsql, 8.0) (push) Has been cancelled
Tests / linux-tests (sqlite, 8.0) (push) Has been cancelled
Fixed errorInfo in pdo exception wrapper. (#78)
2024-09-21 13:04:20 +02:00

18 lines
398 B
PHP

<?php
class PDOExceptionWithQueryString extends PDOException {
public string $queryString = "";
/**
* Wrapper for PDOException to avoid creating dynamic property.
*
* @param PDOException $e Source exception.
*/
public function __construct(PDOException $e) {
parent::__construct($e->getMessage(), 0, $e->getPrevious());
$this->errorInfo = $e->errorInfo;
$this->code = $e->code;
}
}