DB urser errors as user expcetions
gitea/php-vn-lib/pipeline/head This commit looks good Details

This commit is contained in:
Juan Ferrer 2021-03-31 12:50:17 +02:00
parent 5b0d36ada9
commit 62150566b1
2 changed files with 8 additions and 4 deletions

View File

@ -320,10 +320,14 @@ class Connection {
* throwing a @Exception exception if any.
*/
function checkError() {
if ($this->conn->errno)
throw new Exception($this->conn->errno, $this->conn->error);
if ($this->conn->errno) {
if ($this->conn->errno != 1644)
throw new Exception($this->conn->errno, $this->conn->error);
else
throw new Vn\Lib\UserException($this->conn->error, $this->conn->errno);
}
}
/**
* Check if there have been warnings in the last query.
*

2
debian/changelog vendored
View File

@ -1,4 +1,4 @@
php-vn-lib (2.1.7) stable; urgency=low
php-vn-lib (2.1.8) stable; urgency=low
* Initial Release.