Remove unneeded parameter in DatabaseException
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
This commit is contained in:
parent
989614f9d5
commit
b8ed028870
|
@ -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 {
|
||||||
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 {
|
||||||
} 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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue