]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Get better PEAR:DB error logging (debuginfo included)
authorMikael Nordfeldth <mmn@hethane.se>
Sun, 19 Apr 2015 22:02:13 +0000 (00:02 +0200)
committerMikael Nordfeldth <mmn@hethane.se>
Sun, 19 Apr 2015 22:02:13 +0000 (00:02 +0200)
lib/schema.php

index 94cde28f9d4692610a5b00cafd11c693ca61f1b5..0421bcb8103ca0cada0d1e233d2e33fe5e7a743e 100644 (file)
@@ -350,7 +350,7 @@ class Schema
         $res = $this->conn->query("DROP TABLE $name");
 
         if ($_PEAR->isError($res)) {
-            throw new Exception($res->getMessage());
+            PEAR_ErrorToPEAR_Exception($res);
         }
 
         return true;
@@ -389,7 +389,7 @@ class Schema
                                    implode(",", $columnNames).")");
 
         if ($_PEAR->isError($res)) {
-            throw new Exception($res->getMessage());
+            PEAR_ErrorToPEAR_Exception($res);
         }
 
         return true;
@@ -411,7 +411,7 @@ class Schema
         $res = $this->conn->query("ALTER TABLE $table DROP INDEX $name");
 
         if ($_PEAR->isError($res)) {
-            throw new Exception($res->getMessage());
+            PEAR_ErrorToPEAR_Exception($res);
         }
 
         return true;
@@ -436,7 +436,7 @@ class Schema
         $res = $this->conn->query($sql);
 
         if ($_PEAR->isError($res)) {
-            throw new Exception($res->getMessage());
+            PEAR_ErrorToPEAR_Exception($res);
         }
 
         return true;
@@ -463,7 +463,7 @@ class Schema
         $res = $this->conn->query($sql);
 
         if ($_PEAR->isError($res)) {
-            throw new Exception($res->getMessage());
+            PEAR_ErrorToPEAR_Exception($res);
         }
 
         return true;
@@ -489,7 +489,7 @@ class Schema
         $res = $this->conn->query($sql);
 
         if ($_PEAR->isError($res)) {
-            throw new Exception($res->getMessage());
+            PEAR_ErrorToPEAR_Exception($res);
         }
 
         return true;
@@ -535,7 +535,7 @@ class Schema
             $res = $this->conn->query($sql);
 
             if ($_PEAR->isError($res)) {
-                throw new Exception($res->getMessage());
+                PEAR_ErrorToPEAR_Exception($res);
             }
         }
         return $ok;
@@ -1045,7 +1045,7 @@ class Schema
 
         $res = $this->conn->query($sql);
         if ($_PEAR->isError($res)) {
-            throw new Exception($res->getMessage());
+            PEAR_ErrorToPEAR_Exception($res);
         }
 
         $out = array();