[wp-trac] [WordPress Trac] #41424: Use a better error message than "Error establishing a database connection" when site isn't found

WordPress Trac noreply at wordpress.org
Wed Nov 22 08:59:01 UTC 2017


#41424: Use a better error message than "Error establishing a database connection"
when site isn't found
------------------------------------------+-----------------------------
 Reporter:  tthorp                        |       Owner:
     Type:  enhancement                   |      Status:  new
 Priority:  normal                        |   Milestone:  Future Release
Component:  Database                      |     Version:  4.9
 Severity:  normal                        |  Resolution:
 Keywords:  needs-patch needs-unit-tests  |     Focuses:  multisite
------------------------------------------+-----------------------------

Comment (by dd32):

 I'm not sure I'd go with `wp_die()` in this case - given it's a potential
 route to end up at with an overloaded multisite database. The obfuscation
 is there for two main cases 1) to not put up a WordPress-branded error
 page when it's not WordPress's fault, and 2) not put information on a page
 that's likely to end up in indexes or be seen by people whom it's not
 useful to.

 However, changing it from `dead_db();` to `die( "<h1>Site $domain not
 found.</h1>" );` (with some escaping) could achieve the same result in
 this case, while also giving enough of a hint as to what the issue is.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/41424#comment:5>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list