aboutsummaryrefslogtreecommitdiffstats
path: root/lib/db.php
diff options
context:
space:
mode:
authorRobin Appelman <icewind@owncloud.com>2012-02-25 20:27:16 +0100
committerRobin Appelman <icewind@owncloud.com>2012-02-25 20:27:16 +0100
commit4f627c428eb64fae307ea293e8093e345d742edc (patch)
treeb14d265ce4ed7ab7ce0fcc381605bd9a1ecaafda /lib/db.php
parentdda79a90cf50f98c1dc4c98401be8707b7103346 (diff)
downloadnextcloud-server-4f627c428eb64fae307ea293e8093e345d742edc.tar.gz
nextcloud-server-4f627c428eb64fae307ea293e8093e345d742edc.zip
some more error reporting during filesystem scan
Diffstat (limited to 'lib/db.php')
-rw-r--r--lib/db.php25
1 files changed, 22 insertions, 3 deletions
diff --git a/lib/db.php b/lib/db.php
index 4c17cd0dbd1..02eac7cac9a 100644
--- a/lib/db.php
+++ b/lib/db.php
@@ -508,6 +508,21 @@ class OC_DB {
self::$connection->commit();
self::$inTransaction=false;
}
+
+ /**
+ * check if a result is an error, works with MDB2 and PDOException
+ * @param mixed $result
+ * @return bool
+ */
+ public static function isError($result){
+ if(!$result){
+ return true;
+ }elseif(self::$backend==self::BACKEND_MDB2 and PEAR::isError($result)){
+ return true;
+ }else{
+ return false;
+ }
+ }
}
/**
@@ -527,11 +542,15 @@ class PDOStatementWrapper{
public function execute($input=array()){
$this->lastArguments=$input;
if(count($input)>0){
- $this->statement->execute($input);
+ $result=$this->statement->execute($input);
}else{
- $this->statement->execute();
+ $result=$this->statement->execute();
+ }
+ if($result){
+ return $this;
+ }else{
+ return false;
}
- return $this;
}
/**