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:
1 parent
2576a0fd23
commit
09ab1d1be6
2 files changed
+6
-1
No files matched your search
@@ -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) {
|
} catch (e) {
|
||||||
logMessage({
|
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",
|
type: "error",
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user