Permalink
Browse files

Adding more verbose info to connection errors.

The start page now shows the connection exception message.
Fixes #875
  • Loading branch information...
1 parent 254357e commit 50b253565a616776d434645d5345358aa0fab640 @markstory markstory committed Nov 12, 2011
Showing with 3 additions and 1 deletion.
  1. +3 −1 lib/Cake/View/Pages/home.ctp
@@ -97,7 +97,7 @@ if (isset($filePresent)):
App::uses('ConnectionManager', 'Model');
try {
$connected = ConnectionManager::getDataSource('default');
- } catch (Exception $e) {
+ } catch (Exception $connectionError) {
$connected = false;
}
?>
@@ -110,6 +110,8 @@ if (isset($filePresent)):
else:
echo '<span class="notice">';
echo __d('cake_dev', 'Cake is NOT able to connect to the database.');
+ echo '<br /><br />';
+ echo $connectionError->getMessage();
echo '</span>';
endif;
?>

0 comments on commit 50b2535

Please sign in to comment.