sphinx query shall handle execute exceptions

Signed-off-by: Janos SUTO <sj@acts.hu>
This commit is contained in:
Janos SUTO 2023-01-25 12:22:38 +01:00
parent 18a0ff5678
commit b463da69fa

View File

@ -39,8 +39,11 @@ class Sphinx {
$s = $this->link->prepare($sql);
if(!$s) { return $query; }
if(!$s->execute($arr)) {
syslog(LOG_INFO, $s->errorInfo()[2]);
try {
$s->execute($arr);
} catch(PDOException $exception) {
syslog(LOG_INFO, "ERROR: " . $exception->getMessage());
return $query;
}
$this->affected = $s->rowCount();