diff options
author | Thomas Tanghus <thomas@tanghus.net> | 2012-11-05 16:24:16 +0100 |
---|---|---|
committer | Thomas Tanghus <thomas@tanghus.net> | 2012-11-05 16:24:16 +0100 |
commit | a50f98606de9ff43b7c8185609af92d48295ae71 (patch) | |
tree | 3ec58de825b9e546cc4123e5a2b11601af54f5d5 /lib | |
parent | 7a29137e2b5b0fb6e931822f015c86014b2be55f (diff) | |
download | nextcloud-server-a50f98606de9ff43b7c8185609af92d48295ae71.tar.gz nextcloud-server-a50f98606de9ff43b7c8185609af92d48295ae71.zip |
Check DB result.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/vcategories.php | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/vcategories.php b/lib/vcategories.php index bae9e3d0391..406a4eb1074 100644 --- a/lib/vcategories.php +++ b/lib/vcategories.php @@ -675,6 +675,9 @@ class OC_VCategories { $stmt = OCP\DB::prepare('DELETE FROM `' . self::CATEGORY_TABLE . '` WHERE ' . '`uid` = ? AND `type` = ? AND `category` = ?'); $result = $stmt->execute(array($this->user, $this->type, $name)); + if (OC_DB::isError($result)) { + OC_Log::write('core', __METHOD__. 'DB error: ' . OC_DB::getErrorMessage($result), OC_Log::ERROR); + } } catch(Exception $e) { OCP\Util::writeLog('core', __METHOD__ . ', exception: ' . $e->getMessage(), OCP\Util::ERROR); @@ -684,7 +687,10 @@ class OC_VCategories { $sql = 'DELETE FROM `' . self::RELATION_TABLE . '` ' . 'WHERE `categoryid` = ?'; $stmt = OCP\DB::prepare($sql); - $stmt->execute(array($id)); + $result = $stmt->execute(array($id)); + if (OC_DB::isError($result)) { + OC_Log::write('core', __METHOD__. 'DB error: ' . OC_DB::getErrorMessage($result), OC_Log::ERROR); + } } catch(Exception $e) { OCP\Util::writeLog('core', __METHOD__.', exception: '.$e->getMessage(), OCP\Util::ERROR); |