dblayer : delete : raise a valid exception if the delete can't be done

git-svn-id: https://svn.fournier38.fr/svn/ProgSVN/trunk@2901 bf3deb0d-5f1a-0410-827f-c0cc1f45334c
This commit is contained in:
2016-07-18 14:00:56 +00:00
parent 68a38804b8
commit e15945f4df

View File

@@ -952,7 +952,14 @@ class dblayer
if ($this->debug) echo "DEBUG BIND : primary->".
var_export ($deletekey, TRUE)."\n";
$st->bindValue (":primary", $deletekey);
$st->execute ();
try
{
$st->execute ();
}
catch (Exception $e)
{
throw new \Exception ($e->getMessage (), 500);
}
$nbLinesDeleted = $st->rowCount();
$nbLinesDeleted = $this->hookpostdelete ($deletekey, $nbLinesDeleted);
return $nbLinesDeleted;