feat: provide a helpful error message if no DB access#993
feat: provide a helpful error message if no DB access#993JohnVillalovos merged 1 commit intodevelopfrom
Conversation
There was a problem hiding this comment.
Pull request overview
Adds a more specific, actionable error message when the app fails to connect/select the database, instead of always showing “Unknown Error”.
Changes:
- Map DB connection/select failures to a new
ErrorMessages::DATABASE_CONNECTIONerror ID in the global web exception handler. - Add the new error message ID/resource key mapping.
- Add the English (en_us) localized string for the new DB connection error.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| lib/Common/Logging/ExceptionHandler.php | Detects DB connection/select exceptions and routes to a specific error message ID. |
| lib/Common/ErrorMessages.php | Introduces DATABASE_CONNECTION and maps it to DatabaseConnectionError. |
| lang/en_us.php | Adds the user-facing DatabaseConnectionError string. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
804614a to
02c68b2
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 4 out of 4 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
02c68b2 to
c9844d4
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
If unable to access the database provide a helpful error message. Now the error message will say: Unable to connect to the database. Ask the website administrator to verify that the database has been created/initialized. They should also verify that the config/config.php database configuration is correct. Previously it said: Unknown Error Added machine translations of the error messages for German, Spanish, and Japanese.
c9844d4 to
b6c33bd
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 9 out of 9 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
If unable to access the database provide a helpful error message.
Now the error message will say:
Unable to connect to the database. Ask the website administrator to
verify that the database has been created/initialized. They should
also verify that the
config/config.phpdatabase configuration iscorrect.
Previously it said:
Unknown Error