nulib/php/src/db/pgsql/PgsqlException.php

17 lines
345 B
PHP

<?php
namespace nulib\db\pgsql;
use Exception;
use RuntimeException;
use SQLite3;
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);
}
}