Commit 74ffda82 authored by Arthur Schiwon's avatar Arthur Schiwon
Browse files

do not output DB information, and do not set header

parent 08205c63
...@@ -71,7 +71,13 @@ class Adapter { ...@@ -71,7 +71,13 @@ class Adapter {
$entry = 'DB Error: "'.$e->getMessage() . '"<br />'; $entry = 'DB Error: "'.$e->getMessage() . '"<br />';
$entry .= 'Offending command was: ' . $query.'<br />'; $entry .= 'Offending command was: ' . $query.'<br />';
\OC_Log::write('core', $entry, \OC_Log::FATAL); \OC_Log::write('core', $entry, \OC_Log::FATAL);
throw new \OC\HintException($entry); $l = \OC::$server->getL10N('lib');
throw new \OC\HintException(
$l->t('Database Error'),
$l->t('Please contact your system administrator.'),
0,
$e
);
} }
} }
} }
...@@ -41,7 +41,13 @@ class AdapterSqlite extends Adapter { ...@@ -41,7 +41,13 @@ class AdapterSqlite extends Adapter {
$entry = 'DB Error: "'.$e->getMessage() . '"<br />'; $entry = 'DB Error: "'.$e->getMessage() . '"<br />';
$entry .= 'Offending command was: ' . $query . '<br />'; $entry .= 'Offending command was: ' . $query . '<br />';
\OC_Log::write('core', $entry, \OC_Log::FATAL); \OC_Log::write('core', $entry, \OC_Log::FATAL);
throw new \OC\HintException($entry); $l = \OC::$server->getL10N('lib');
throw new \OC\HintException(
$l->t('Database Error'),
$l->t('Please contact your system administrator.'),
0,
$e
);
} }
if ($stmt->fetchColumn() === '0') { if ($stmt->fetchColumn() === '0') {
...@@ -59,7 +65,13 @@ class AdapterSqlite extends Adapter { ...@@ -59,7 +65,13 @@ class AdapterSqlite extends Adapter {
$entry = 'DB Error: "'.$e->getMessage() . '"<br />'; $entry = 'DB Error: "'.$e->getMessage() . '"<br />';
$entry .= 'Offending command was: ' . $query.'<br />'; $entry .= 'Offending command was: ' . $query.'<br />';
\OC_Log::write('core', $entry, \OC_Log::FATAL); \OC_Log::write('core', $entry, \OC_Log::FATAL);
throw new \OC\HintException($entry); $l = \OC::$server->getL10N('lib');
throw new \OC\HintException(
$l->t('Database Error'),
$l->t('Please contact your system administrator.'),
0,
$e
);
} }
return $result; return $result;
......
...@@ -158,10 +158,13 @@ class OC_DB_StatementWrapper { ...@@ -158,10 +158,13 @@ class OC_DB_StatementWrapper {
OC_Log::write('core', $entry, OC_Log::FATAL); OC_Log::write('core', $entry, OC_Log::FATAL);
OC_User::setUserId(null); OC_User::setUserId(null);
// send http status 503 $l = \OC::$server->getL10N('lib');
header('HTTP/1.1 503 Service Temporarily Unavailable'); throw new \OC\HintException(
header('Status: 503 Service Temporarily Unavailable'); $l->t('Database Error'),
throw new \OC\HintException($entry); $l->t('Please contact your system administrator.'),
0,
$e
);
} }
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment