File "Exception-20250329031748.php"
Full Path: /home/pulsehostuk9/public_html/invoicer.pulsehost.co.uk/vendor/doctrine/dbal/src/Driver/PDO/Exception-20250329031748.php
File size: 617 bytes
MIME-type: text/x-php
Charset: utf-8
<?php
declare(strict_types=1);
namespace Doctrine\DBAL\Driver\PDO;
use Doctrine\DBAL\Driver\AbstractException;
use PDOException;
/**
* @internal
*
* @psalm-immutable
*/
final class Exception extends AbstractException
{
public static function new(PDOException $exception): self
{
if ($exception->errorInfo !== null) {
[$sqlState, $code] = $exception->errorInfo;
$code ??= 0;
} else {
$code = $exception->getCode();
$sqlState = null;
}
return new self($exception->getMessage(), $sqlState, $code, $exception);
}
}