This repository has been archived on 2025-06-02. You can view files and clone it, but cannot push or open issues or pull requests.
nulib/php/src/db/pgsql/PgsqlException.php

16 lines
332 B
PHP

<?php
namespace nulib\db\pgsql;
use Exception;
use RuntimeException;
class PgsqlException extends RuntimeException {
static final function last_error($db): self {
return new static(pg_last_error($db));
}
static final function wrap(Exception $e): self {
return new static($e->getMessage(), $e->getCode(), $e);
}
}