From b8ed028870c36a5471df264d64dcdee6074096c9 Mon Sep 17 00:00:00 2001 From: Morris Jobke Date: Mon, 24 Jul 2017 13:44:12 +0200 Subject: Remove unneeded parameter in DatabaseException Signed-off-by: Morris Jobke --- lib/private/DatabaseException.php | 11 ----------- lib/private/legacy/db.php | 4 ++-- 2 files changed, 2 insertions(+), 13 deletions(-) (limited to 'lib/private') diff --git a/lib/private/DatabaseException.php b/lib/private/DatabaseException.php index 7ca7435c028..68b617e4c75 100644 --- a/lib/private/DatabaseException.php +++ b/lib/private/DatabaseException.php @@ -24,15 +24,4 @@ namespace OC; class DatabaseException extends \Exception { - private $query; - - //FIXME getQuery seems to be unused, maybe use parent constructor with $message, $code and $previous - public function __construct($message, $query = null){ - parent::__construct($message); - $this->query = $query; - } - - public function getQuery() { - return $this->query; - } } diff --git a/lib/private/legacy/db.php b/lib/private/legacy/db.php index 415701d4024..9e4d619d953 100644 --- a/lib/private/legacy/db.php +++ b/lib/private/legacy/db.php @@ -65,7 +65,7 @@ class OC_DB { try { $result =$connection->prepare($query, $limit, $offset); } catch (\Doctrine\DBAL\DBALException $e) { - throw new \OC\DatabaseException($e->getMessage(), $query); + throw new \OC\DatabaseException($e->getMessage()); } // differentiate between query and manipulation $result = new OC_DB_StatementWrapper($result, $isManipulation); @@ -214,7 +214,7 @@ class OC_DB { } else { $message .= ', Root cause:' . self::getErrorMessage(); } - throw new \OC\DatabaseException($message, \OC::$server->getDatabaseConnection()->errorCode()); + throw new \OC\DatabaseException($message); } } -- cgit v1.2.3