diff options
author | Evan Prodromou <evan@controlyourself.ca> | 2009-06-14 14:01:11 -0700 |
---|---|---|
committer | Evan Prodromou <evan@controlyourself.ca> | 2009-06-14 14:01:11 -0700 |
commit | 9addfeacfdacf1eb8c6a90a636f468e4aeb0e9fe (patch) | |
tree | 231ad34ab3bb01e2b980a7e423bbbc92d499328a /index.php | |
parent | 7f76c36f24bd51fd4f204f363d5ddf35e9ea9950 (diff) |
better handling of PEAR errors
Diffstat (limited to 'index.php')
-rw-r--r-- | index.php | 21 |
1 files changed, 13 insertions, 8 deletions
@@ -48,13 +48,18 @@ function handleError($error) $logmsg .= " : ". $error->getDebugInfo(); } common_log(LOG_ERR, $logmsg); - $msg = sprintf(_('The database for %s isn\'t responding correctly, '. - 'so the site won\'t work properly. '. - 'The site admins probably know about the problem, '. - 'but you can contact them at %s to make sure. '. - 'Otherwise, wait a few minutes and try again.'), - common_config('site', 'name'), - common_config('site', 'email')); + if ($error instanceof DB_DataObject_Error) { + $msg = sprintf(_('The database for %s isn\'t responding correctly, '. + 'so the site won\'t work properly. '. + 'The site admins probably know about the problem, '. + 'but you can contact them at %s to make sure. '. + 'Otherwise, wait a few minutes and try again.'), + common_config('site', 'name'), + common_config('site', 'email')); + } else { + $msg = _('An important error occured, probably related to email setup. '. + 'Check logfiles for more info..'); + } $dac = new DBErrorAction($msg, 500); $dac->showPage(); @@ -70,7 +75,7 @@ function main() global $user, $action, $config; Snapshot::check(); - + if (!_have_config()) { $msg = sprintf(_("No configuration file found. Try running ". "the installation program first.")); |