Opened 15 years ago
Last modified 9 months ago
#10883 assigned enhancement
db-error.php not used for all DB failures
Reported by: | markjaquith | Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | 2.8.4 |
Component: | Database | Keywords: | needs-patch |
Focuses: | Cc: |
Description
db-error.php (the optional custom DB error message file to be placed in wp-content) does not get included all the time. Sometimes wp-db.php will use its bail()
method to spit out its own message. This code needs to be there too:
if ( file_exists( WP_CONTENT_DIR . '/db-error.php' ) ) { require_once( WP_CONTENT_DIR . '/db-error.php' ); die(); }
Change History (11)
#3
@
14 years ago
- Keywords 2nd-opinion added
- Milestone changed from 3.0 to 3.1
- Type changed from defect (bug) to enhancement
#6
@
12 years ago
Has anything changed regarding this subject? db-error.php on the backend or even a second backend version would be useful, clients aren't always looking at the frontend and you're more likely to suffer the consequences of bad reputation and lost revenue when the person paying you money gets an obscure generic DB error while saving a post, than a random user who gets one on the frontend and just closes the tab.
A lot of db-error.php implementations send notification emails, so if such an error occurs on the backend, said email won't be sent despite the expectation from most that it will.
#7
@
12 years ago
- Cc jose@… added
I am also wondering if this is going to be implemented any time soon. It is not true that the standard message appears only on the back-end. In my experience db-error.php is not called if there is a connection error on the front-end. For the time being, I just added the conditional below just before the bail function as suggested above.
if ( file_exists( WP_CONTENT_DIR . '/db-error.php' ) ) { require_once( WP_CONTENT_DIR . '/db-error.php' ); die(); }
If you don't want to do it permanently, at least give us a filter so we can change it through a custom function.
Thanks.
The purpose of the db-error.php was for prettying up the front-end database connection error screen, or giving some other form of feedback. It has never affected the back-end.
I'm not sure using it for the backend failure cases is a good idea, it'll mean that anyone currently using the file will have to modify it in order to see the DB errors.
Shifting to 3.1 pending patch & feedback from others..