feat(create-medusa-app): print error message for failed db connection (#5547)
`create-medusa-app` currently prints a generic error message when it cannot connect to a database. This tiny pull request adds the thrown error to the log message, that simplifies debugging of installation issues
This commit is contained in:
5
.changeset/quick-seals-teach.md
Normal file
5
.changeset/quick-seals-teach.md
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"create-medusa-app": patch
|
||||
---
|
||||
|
||||
feat(create-medusa-app): print error message for failed database connection
|
||||
@@ -94,7 +94,7 @@ async function getForDbName(dbName: string): Promise<{
|
||||
})
|
||||
} catch (e) {
|
||||
logMessage({
|
||||
message: `Couldn't connect to PostgreSQL. Make sure you have PostgreSQL installed and the credentials you provided are correct.${EOL}${EOL}You can learn how to install PostgreSQL here: https://docs.medusajs.com/development/backend/prepare-environment?os=${getCurrentOs()}#postgresql${EOL}${EOL}If you keep running into this issue despite having PostgreSQL installed, please check out our troubleshooting guidelines: https://docs.medusajs.com/troubleshooting/database-error`,
|
||||
message: `Couldn't connect to PostgreSQL because of the following error: ${e}.${EOL}${EOL}Make sure you have PostgreSQL installed and the credentials you provided are correct.${EOL}${EOL}You can learn how to install PostgreSQL here: https://docs.medusajs.com/development/backend/prepare-environment?os=${getCurrentOs()}#postgresql${EOL}${EOL}If you keep running into this issue despite having PostgreSQL installed, please check out our troubleshooting guidelines: https://docs.medusajs.com/troubleshooting/database-error`,
|
||||
type: "error",
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user