-
Notifications
You must be signed in to change notification settings - Fork 334
feat: provide a helpful error message if no DB access #993
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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