diff --git a/public/setup.php b/public/setup.php index a538f417..9bd621a3 100644 --- a/public/setup.php +++ b/public/setup.php @@ -334,23 +334,29 @@ EOF;

Database Update

getMessage()); + echo "

Something went wrong while trying to connect to the database. A message should be logged - check PHP's error_log (" . ini_get('error_log') . ')

\n'; + error_log("Couldn't perform PostfixAdmin database update - failed to connect to db? " . $e->getMessage() . " Trace: " . $e->getTraceAsString()); } if ($db) { - print "

Everything seems fine... attempting to create/update database structure

\n"; - require_once(dirname(__FILE__) . '/upgrade.php'); + echo "

Everything seems fine... attempting to create/update database structure

\n"; + try { + require_once(dirname(__FILE__) . '/upgrade.php'); + } + catch(\Exception $e) { + if($authenticated) { + echo "

Exception message: {$e->getMessage()} - check logs!

"; + } + echo "

Something went wrong while trying to apply database updates, a message should be logged - check PHP's error_log (" . ini_get('error_log') . ')

\n'; + error_log("Couldn't perform PostfixAdmin database update via upgrade.php - " . $e->getMessage() . " Trace: " . $e->getTraceAsString()); + } } else { echo "

Could not connect to database to perform updates; check PHP error log.

"; } - } else { - echo "

Please login to see perform database update.

"; - } ?>