DateQuery: use try-catch around statement prepare.

Signed-off-by: Claus-Justus Heine <himself@claus-justus-heine.de>
This commit is contained in:
Claus-Justus Heine
2023-06-16 10:06:28 +02:00
parent e9ccbd95d6
commit 26930efc25

View File

@@ -109,7 +109,15 @@ class DataQuery
} }
$query = $this->queryProvider[$queryName]; $query = $this->queryProvider[$queryName];
$result = $this->connection->prepare($query, $limit, $offset); try {
$result = $this->connection->prepare($query, $limit, $offset);
} catch (DBALException $exception) {
$this->logger->error(
"Could not prepare the query: " . $exception->getMessage(),
["app" => $this->appName]
);
return false;
}
foreach ($params as $param => $value) { foreach ($params as $param => $value) {
$result->bindValue(":" . $param, $value); $result->bindValue(":" . $param, $value);