Opened 3 years ago

Last modified 5 months ago

#13657 new enhancement

When WP_DEBUG is true show better errors for establishing database connection

Reported by: sivel Owned by: ryan
Priority: low Milestone: Future Release
Component: Database Version:
Severity: trivial Keywords: has-patch
Cc: matt@…, mike@…

Description

Right now no matter if WP_DEBUG is enabled or not we always show some generic errors for Error establishing a database connection

We should display the specific error when WP_DEBUG is enabled.

Attachments (1)

13657.diff (2.6 KB) - added by sivel 3 years ago.

Download all attachments as: .zip

Change History (7)

Patch is just an idea of how we might do this. Open to other suggestions and patches.

sivel3 years ago

I would tend to think we should not be exposing the output of mysql_error() on any site. Or, if we do, then we at least also check for display_errors/WP_DEBUG_DISPLAY, in case they want WP_DEBUG (as can be common in production) but are logging it.

  • Keywords early removed
  • Milestone changed from Awaiting Triage to Future Release

The way that translations are handled for these errors makes it difficult to do conditionals like this. Mainly due to duplicating large portions of code and strings. Well maybe not large but more than I am comfortable with duplicating.

I may just need to stare at the code for a bit to get a creative solution, that is unless someone has recommendations.

  • Cc mike@… added
Note: See TracTickets for help on using tickets.