diff --git a/src/Database/Adapter/SQL.php b/src/Database/Adapter/SQL.php index 16572e4a6..fb949dfa4 100644 --- a/src/Database/Adapter/SQL.php +++ b/src/Database/Adapter/SQL.php @@ -3273,7 +3273,11 @@ public function count(Document $collection, array $queries = [], ?int $max = nul $stmt->bindValue($key, $value, $this->getPDOType($value)); } - $this->execute($stmt); + try { + $this->execute($stmt); + } catch (PDOException $e) { + throw $this->processException($e); + } $result = $stmt->fetchAll(); $stmt->closeCursor(); @@ -3355,7 +3359,11 @@ public function sum(Document $collection, string $attribute, array $queries = [] $stmt->bindValue($key, $value, $this->getPDOType($value)); } - $this->execute($stmt); + try { + $this->execute($stmt); + } catch (PDOException $e) { + throw $this->processException($e); + } $result = $stmt->fetchAll(); $stmt->closeCursor();