summaryrefslogtreecommitdiffstats
path: root/lib/db.php
diff options
context:
space:
mode:
authorBart Visscher <bartv@thisnet.nl>2013-02-23 14:46:37 +0100
committerBart Visscher <bartv@thisnet.nl>2013-02-25 08:27:23 +0100
commite97c7ae806acc1687604a887dd8558c9b7222f5d (patch)
treed376ae94e6d974b8bd937cd4051613e823c9ec05 /lib/db.php
parentd0d9b63ab535d103a2607f6e589ee5c04807d6ce (diff)
downloadnextcloud-server-e97c7ae806acc1687604a887dd8558c9b7222f5d.tar.gz
nextcloud-server-e97c7ae806acc1687604a887dd8558c9b7222f5d.zip
Change PDO Exceptions to Doctrine Exceptions
Diffstat (limited to 'lib/db.php')
-rw-r--r--lib/db.php10
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/db.php b/lib/db.php
index 54b6de947c3..3b2590c3105 100644
--- a/lib/db.php
+++ b/lib/db.php
@@ -191,7 +191,7 @@ class OC_DB {
static public function prepare( $query , $limit=null, $offset=null ) {
if (!is_null($limit) && $limit != -1) {
- //PDO does not handle limit and offset.
+ //Doctrine does not handle limit and offset.
//FIXME: check limit notation for other dbs
//the following sql thus might needs to take into account db ways of representing it
//(oracle has no LIMIT / OFFSET)
@@ -222,7 +222,7 @@ class OC_DB {
if (self::$backend == self::BACKEND_DOCTRINE) {
try {
$result=self::$connection->prepare($query);
- } catch(PDOException $e) {
+ } catch(\Doctrine\DBAL\DBALException $e) {
throw new DatabaseException($e->getMessage(), $query);
}
$result=new DoctrineStatementWrapper($result);
@@ -345,7 +345,7 @@ class OC_DB {
* @brief Insert a row if a matching row doesn't exists.
* @param string $table. The table to insert into in the form '*PREFIX*tableName'
* @param array $input. An array of fieldname/value pairs
- * @returns The return value from PDOStatementWrapper->execute()
+ * @returns The return value from DoctrineStatementWrapper->execute()
*/
public static function insertIfNotExist($table, $input) {
self::connect();
@@ -370,7 +370,7 @@ class OC_DB {
try {
$stmt = self::prepare($query);
$result = $stmt->execute();
- } catch(PDOException $e) {
+ } catch(\Doctrine\DBAL\DBALException $e) {
$entry = 'DB Error: "'.$e->getMessage() . '"<br />';
$entry .= 'Offending command was: ' . $query . '<br />';
OC_Log::write('core', $entry, OC_Log::FATAL);
@@ -402,7 +402,7 @@ class OC_DB {
try {
$result = self::prepare($query);
- } catch(PDOException $e) {
+ } catch(\Doctrine\DBAL\DBALException $e) {
$entry = 'DB Error: "'.$e->getMessage() . '"<br />';
$entry .= 'Offending command was: ' . $query.'<br />';
OC_Log::write('core', $entry, OC_Log::FATAL);