summaryrefslogtreecommitdiffstats
path: root/lib/private/db
diff options
context:
space:
mode:
Diffstat (limited to 'lib/private/db')
-rw-r--r--lib/private/db/adapter.php3
-rw-r--r--lib/private/db/adaptersqlite.php4
-rw-r--r--lib/private/db/statementwrapper.php7
3 files changed, 7 insertions, 7 deletions
diff --git a/lib/private/db/adapter.php b/lib/private/db/adapter.php
index 972008776f6..93d69cf4183 100644
--- a/lib/private/db/adapter.php
+++ b/lib/private/db/adapter.php
@@ -43,6 +43,7 @@ class Adapter {
* insert the @input values when they do not exist yet
* @param string $table name
* @param array $input key->value pair, key has to be sanitized properly
+ * @throws \OC\HintException
* @return int count of inserted rows
*/
public function insertIfNotExist($table, $input) {
@@ -71,7 +72,7 @@ class Adapter {
$entry .= 'Offending command was: ' . $query.'<br />';
\OC_Log::write('core', $entry, \OC_Log::FATAL);
error_log('DB error: ' . $entry);
- \OC_Template::printErrorPage( $entry );
+ throw new \OC\HintException($entry);
}
}
}
diff --git a/lib/private/db/adaptersqlite.php b/lib/private/db/adaptersqlite.php
index 3471fcf4042..fa0e7eb6237 100644
--- a/lib/private/db/adaptersqlite.php
+++ b/lib/private/db/adaptersqlite.php
@@ -42,7 +42,7 @@ class AdapterSqlite extends Adapter {
$entry .= 'Offending command was: ' . $query . '<br />';
\OC_Log::write('core', $entry, \OC_Log::FATAL);
error_log('DB error: '.$entry);
- \OC_Template::printErrorPage( $entry );
+ throw new \OC\HintException($entry);
}
if ($stmt->fetchColumn() === '0') {
@@ -61,7 +61,7 @@ class AdapterSqlite extends Adapter {
$entry .= 'Offending command was: ' . $query.'<br />';
\OC_Log::write('core', $entry, \OC_Log::FATAL);
error_log('DB error: ' . $entry);
- \OC_Template::printErrorPage( $entry );
+ throw new \OC\HintException($entry);
}
return $result;
diff --git a/lib/private/db/statementwrapper.php b/lib/private/db/statementwrapper.php
index ad63de98e93..8d972411fe4 100644
--- a/lib/private/db/statementwrapper.php
+++ b/lib/private/db/statementwrapper.php
@@ -64,7 +64,7 @@ class OC_DB_StatementWrapper {
} else {
$result = $this->statement->execute();
}
-
+
if ($result === false) {
return false;
}
@@ -161,11 +161,10 @@ class OC_DB_StatementWrapper {
// send http status 503
header('HTTP/1.1 503 Service Temporarily Unavailable');
header('Status: 503 Service Temporarily Unavailable');
- OC_Template::printErrorPage('Failed to connect to database');
- die ($entry);
+ throw new \OC\HintException($entry);
}
}
-
+
/**
* provide an alias for fetch
*