Skip to content
Snippets Groups Projects
Commit 5dc480a3 authored by Morris Jobke's avatar Morris Jobke Committed by GitHub
Browse files

Merge pull request #5857 from nextcloud/database-exception-cleanup

Remove unneeded parameter in DatabaseException
parents e785b849 b8ed0288
No related branches found
No related tags found
No related merge requests found
...@@ -24,15 +24,4 @@ ...@@ -24,15 +24,4 @@
namespace OC; namespace OC;
class DatabaseException extends \Exception { 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;
}
} }
...@@ -65,7 +65,7 @@ class OC_DB { ...@@ -65,7 +65,7 @@ class OC_DB {
try { try {
$result =$connection->prepare($query, $limit, $offset); $result =$connection->prepare($query, $limit, $offset);
} catch (\Doctrine\DBAL\DBALException $e) { } catch (\Doctrine\DBAL\DBALException $e) {
throw new \OC\DatabaseException($e->getMessage(), $query); throw new \OC\DatabaseException($e->getMessage());
} }
// differentiate between query and manipulation // differentiate between query and manipulation
$result = new OC_DB_StatementWrapper($result, $isManipulation); $result = new OC_DB_StatementWrapper($result, $isManipulation);
...@@ -214,7 +214,7 @@ class OC_DB { ...@@ -214,7 +214,7 @@ class OC_DB {
} else { } else {
$message .= ', Root cause:' . self::getErrorMessage(); $message .= ', Root cause:' . self::getErrorMessage();
} }
throw new \OC\DatabaseException($message, \OC::$server->getDatabaseConnection()->errorCode()); throw new \OC\DatabaseException($message);
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment