Skip to content
Snippets Groups Projects
Commit 7ed678b0 authored by Arthur Schiwon's avatar Arthur Schiwon
Browse files

eliminate OC_Template::printErrorPage in database classes, fixes #12182

parent 0f3c5d85
No related branches found
No related tags found
No related merge requests found
......@@ -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);
}
}
}
......@@ -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;
......
......@@ -161,8 +161,7 @@ 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);
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment