2
0
forked from Wavyzz/dolibarr
This commit is contained in:
Laurent Destailleur
2020-12-02 16:35:43 +01:00
parent 5bdd52500d
commit 9e18997e64
5 changed files with 20 additions and 4 deletions

View File

@@ -1817,7 +1817,11 @@ abstract class CommonObject
return -2;
}
} else {
$this->error = $this->db->lasterror();
if ($this->db->lasterrno() == 'DB_ERROR_RECORD_ALREADY_EXISTS') {
$this->error = 'DB_ERROR_RECORD_ALREADY_EXISTS';
} else {
$this->error = $this->db->lasterror();
}
$this->db->rollback();
return -1;
}