Skip to content

Commit 6c2fdaf

Browse files
committed
Add catch for MySQLi exceptions
Exceptions now reported by default under PHP 8.1+
1 parent ded10d1 commit 6c2fdaf

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/DataConnector/DataConnector_mysqli.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1497,7 +1497,11 @@ public function getTools()
14971497
*/
14981498
private function executeQuery($sql, $stmt, $reportError = true)
14991499
{
1500-
$ok = $stmt->execute();
1500+
try {
1501+
$ok = $stmt->execute();
1502+
} catch (\Exception $e) {
1503+
$ok = false;
1504+
}
15011505
$info = $this->db->info;
15021506
if (!empty($info)) {
15031507
$info = PHP_EOL . $info;

0 commit comments

Comments
 (0)