From 8e378ec0452e711b4ab9fb95c8fc4957e446eedf Mon Sep 17 00:00:00 2001 From: skodak Date: Sun, 13 Jul 2008 20:28:08 +0000 Subject: [PATCH] MDL-15071 improved error logging - credit goes to Andrei Bautu --- lib/dml/pdo_moodle_database.php | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/lib/dml/pdo_moodle_database.php b/lib/dml/pdo_moodle_database.php index 1a432252f1..fbc8369fe7 100644 --- a/lib/dml/pdo_moodle_database.php +++ b/lib/dml/pdo_moodle_database.php @@ -177,7 +177,18 @@ abstract class pdo_moodle_database extends moodle_database { * @return bool success */ public function change_database_structure($sql) { - return $this->execute($sql); + try { + $this->lastError = null; + if($this->debug) { + $this->debug_query($sql); + } + $this->pdb->exec($sql); + return true; + } catch (PDOException $ex) { + $this->lastError = $ex->getMessage(); + $this->report_error($sql, null, $ex); + return false; + } } public function delete_records_select($table, $select, array $params=null) { -- 2.39.5