From 4afe82f3e23ca604060674045b60defbffa6e7e9 Mon Sep 17 00:00:00 2001 From: Bob Trahan Date: Mon, 21 Nov 2011 16:29:44 -0800 Subject: [PATCH] Show MySQL exception when unable to connect during setup Summary: a well-titled diff this be. i feel 'meh' about the change; doesn't seem to help too much imo. Test Plan: edited my custom conf file to have errors - 127.0.0.1 => 127.0.0.2 mysql_user => mysql_users and for phabricator to be in setup mode. for each error i verified that i liked the display. Reviewers: epriestley, jungejason Reviewed By: jungejason CC: aran, jungejason Differential Revision: 1129 --- src/infrastructure/setup/PhabricatorSetup.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/infrastructure/setup/PhabricatorSetup.php b/src/infrastructure/setup/PhabricatorSetup.php index 59648608f6..7fc9c1784c 100644 --- a/src/infrastructure/setup/PhabricatorSetup.php +++ b/src/infrastructure/setup/PhabricatorSetup.php @@ -399,12 +399,13 @@ class PhabricatorSetup { queryfx($conn_raw, 'SELECT 1'); self::write(" okay Connection successful!\n"); } catch (AphrontQueryConnectionException $ex) { + $message = $ex->getMessage(); self::writeFailure(); self::write( - "Setup failure! Unable to connect to MySQL database ". - "'{$conn_host}' with user '{$conn_user}'. Edit Phabricator ". - "configuration keys 'mysql.user', 'mysql.host' and 'mysql.pass' to ". - "enable Phabricator to connect."); + "Setup failure! MySQL exception: {$message} \n". + "Edit Phabricator configuration keys 'mysql.user', ". + "'mysql.host' and 'mysql.pass' to enable Phabricator ". + "to connect."); return; }