Skip to content

Commit

Permalink
FIX Throw DatabaseException, not mysqli_sql_exception (#11545)
Browse files Browse the repository at this point in the history
  • Loading branch information
GuySartorelli authored Jan 13, 2025
1 parent 4e151be commit cd1d5de
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/ORM/Connect/MySQLiConnector.php
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,12 @@ public function preparedQuery($sql, $parameters, $errorLevel = E_USER_ERROR)
}

// Safely execute the statement
$statement->execute();
try {
$statement->execute();
} catch (mysqli_sql_exception $e) {
$success = false;
$this->databaseError($e->getMessage(), E_USER_ERROR, $sql, $parameters);
}
}

if (!$success || $statement->error) {
Expand Down

0 comments on commit cd1d5de

Please sign in to comment.