Skip to content

Commit 66093c4

Browse files
committed
Made error message clearer
1 parent 38b8b3c commit 66093c4

2 files changed

Lines changed: 6 additions & 4 deletions

File tree

app/system/Bakery/Command/Setup.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,8 +124,9 @@ public function setupEnv()
124124
$this->io->success("Database connexion successful");
125125
$success = true;
126126
} catch (\PDOException $e) {
127-
$message = "Could not connect to the database '{$dbParams['username']}@{$dbParams['host']}/{$dbParams['database']}'. Please check your database configuration and/or google the exception shown below and run command again:".PHP_EOL;
128-
$message .= "Exception: " . $e->getMessage() . PHP_EOL;
127+
$message = "Could not connect to the database '{$dbParams['username']}@{$dbParams['host']}/{$dbParams['database']}':".PHP_EOL;
128+
$message .= "Exception: " . $e->getMessage() . PHP_EOL.PHP_EOL;
129+
$message .= "Please check your database configuration and/or google the exception shown above and run command again.";
129130
$this->io->error($message);
130131
exit(1);
131132
}

app/system/Bakery/DatabaseTest.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,9 @@ protected function testDB()
4343
try {
4444
Capsule::connection()->getPdo();
4545
} catch (\PDOException $e) {
46-
$message = "Could not connect to the database '{$dbParams['username']}@{$dbParams['host']}/{$dbParams['database']}'. Please check your database configuration and/or google the exception shown below:".PHP_EOL;
47-
$message .= "Exception: " . $e->getMessage() . PHP_EOL;
46+
$message = "Could not connect to the database '{$dbParams['username']}@{$dbParams['host']}/{$dbParams['database']}':".PHP_EOL;
47+
$message .= "Exception: " . $e->getMessage() . PHP_EOL.PHP_EOL;
48+
$message .= "Please check your database configuration and/or google the exception shown above and run command again.";
4849
throw new \Exception($message);
4950
}
5051

0 commit comments

Comments
 (0)