diff options
author | ken restivo <ken@restivo.org> | 2015-11-19 20:58:13 -0800 |
---|---|---|
committer | ken restivo <ken@restivo.org> | 2015-11-19 20:58:13 -0800 |
commit | e56633d5b0009fd5430a15fd09633e8f43bdb7dd (patch) | |
tree | fea3e0bee67d3b1020e3d9c77b204c70d646181f | |
parent | a44795e6c32d90d54e5a4321cad4ffe0f3409a09 (diff) | |
download | volse-hubzilla-e56633d5b0009fd5430a15fd09633e8f43bdb7dd.tar.gz volse-hubzilla-e56633d5b0009fd5430a15fd09633e8f43bdb7dd.tar.bz2 volse-hubzilla-e56633d5b0009fd5430a15fd09633e8f43bdb7dd.zip |
Throw HTTP error and display error message when database is unavailable. #179
-rwxr-xr-x | index.php | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -36,6 +36,12 @@ require_once('include/dba/dba_driver.php'); if(! $a->install) { $db = dba_factory($db_host, $db_port, $db_user, $db_pass, $db_data, $db_type, $a->install); + if(! $db->connected){ + header('HTTP/1.0 520 Unknown Error'); + // TODO: much friendlier error message + die("Database error, contact admin."); + } + unset($db_host, $db_port, $db_user, $db_pass, $db_data, $db_type); /** |