diff options
author | Arthur Schiwon <blizzz@owncloud.com> | 2014-11-14 17:13:51 +0100 |
---|---|---|
committer | Arthur Schiwon <blizzz@owncloud.com> | 2014-11-14 17:43:22 +0100 |
commit | 74ffda8261d4cbe763e9fb610881e36edf5f9b4d (patch) | |
tree | a2171473f150816cfe2cd359c1d8770488f912e3 | |
parent | 08205c63f9324d2697e2ac1a2cb322bc96b197e5 (diff) | |
download | nextcloud-server-74ffda8261d4cbe763e9fb610881e36edf5f9b4d.tar.gz nextcloud-server-74ffda8261d4cbe763e9fb610881e36edf5f9b4d.zip |
do not output DB information, and do not set header
-rw-r--r-- | lib/private/db/adapter.php | 8 | ||||
-rw-r--r-- | lib/private/db/adaptersqlite.php | 16 | ||||
-rw-r--r-- | lib/private/db/statementwrapper.php | 11 |
3 files changed, 28 insertions, 7 deletions
diff --git a/lib/private/db/adapter.php b/lib/private/db/adapter.php index 86f867d099f..58b3514b922 100644 --- a/lib/private/db/adapter.php +++ b/lib/private/db/adapter.php @@ -71,7 +71,13 @@ class Adapter { $entry = 'DB Error: "'.$e->getMessage() . '"<br />'; $entry .= 'Offending command was: ' . $query.'<br />'; \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 + ); } } } diff --git a/lib/private/db/adaptersqlite.php b/lib/private/db/adaptersqlite.php index 39e2491ed08..c5dfa85aaac 100644 --- a/lib/private/db/adaptersqlite.php +++ b/lib/private/db/adaptersqlite.php @@ -41,7 +41,13 @@ class AdapterSqlite extends Adapter { $entry = 'DB Error: "'.$e->getMessage() . '"<br />'; $entry .= 'Offending command was: ' . $query . '<br />'; \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') { @@ -59,7 +65,13 @@ class AdapterSqlite extends Adapter { $entry = 'DB Error: "'.$e->getMessage() . '"<br />'; $entry .= 'Offending command was: ' . $query.'<br />'; \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; diff --git a/lib/private/db/statementwrapper.php b/lib/private/db/statementwrapper.php index 8d972411fe4..a85c0167e0b 100644 --- a/lib/private/db/statementwrapper.php +++ b/lib/private/db/statementwrapper.php @@ -158,10 +158,13 @@ class OC_DB_StatementWrapper { OC_Log::write('core', $entry, OC_Log::FATAL); OC_User::setUserId(null); - // send http status 503 - header('HTTP/1.1 503 Service Temporarily Unavailable'); - header('Status: 503 Service Temporarily Unavailable'); - 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 + ); } } |