[Pkg-owncloud-commits] [owncloud] 08/66: always be verbose when logging db error

David Prévot taffit at moszumanska.debian.org
Fri Apr 18 22:49:42 UTC 2014


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to annotated tag v5.0.15
in repository owncloud.

commit bfcb93b2b9bc3bb1efd2e00c4169fb506e0eebab
Author: Jörn Friedrich Dreyer <jfd at butonic.de>
Date:   Tue Jan 21 12:20:10 2014 +0100

    always be verbose when logging db error
---
 lib/db.php | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/lib/db.php b/lib/db.php
index 84b05df..aee44e5 100644
--- a/lib/db.php
+++ b/lib/db.php
@@ -382,7 +382,7 @@ class OC_DB {
 
 			// Die if we have an error (error means: bad query, not 0 results!)
 			if( self::isError($result)) {
-				throw new DatabaseException($result->getMessage(), $query);
+				throw new DatabaseException(self::getErrorMessage($result), $query);
 			}
 		}else{
 			try{
@@ -1117,10 +1117,8 @@ class OC_DB {
 	 */
 	public static function getErrorMessage($error) {
 		if ( self::$backend==self::BACKEND_MDB2 and PEAR::isError($error) ) {
-			$msg = $error->getCode() . ': ' . $error->getMessage();
-			if (defined('DEBUG') && DEBUG) {
-				$msg .= '(' . $error->getDebugInfo() . ')';
-			}
+			$msg = $error->getCode() . ': ' . $error->getMessage()
+				 . ' (' . $error->getDebugInfo() . ')';
 		} elseif (self::$backend==self::BACKEND_PDO and self::$PDO) {
 			$msg = self::$PDO->errorCode() . ': ';
 			$errorInfo = self::$PDO->errorInfo();

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud.git



More information about the Pkg-owncloud-commits mailing list