[wp-trac] [WordPress Trac] #13657: When WP_DEBUG is true show better errors for establishing database connection

WordPress Trac noreply at wordpress.org
Thu Aug 17 01:39:45 UTC 2017


#13657: When WP_DEBUG is true show better errors for establishing database
connection
-------------------------------------+-----------------------------
 Reporter:  sivel                    |       Owner:
     Type:  enhancement              |      Status:  assigned
 Priority:  low                      |   Milestone:  Future Release
Component:  Database                 |     Version:
 Severity:  trivial                  |  Resolution:
 Keywords:  has-patch needs-refresh  |     Focuses:
-------------------------------------+-----------------------------
Changes (by pento):

 * keywords:  has-patch dev-feedback => has-patch needs-refresh


Comment:

 It would be best to put this in `wpdb::bail()`. That method will always be
 the one called when WPDB needs to kill page loading. There's no need to
 check `WP_DEBUG && WP_DEBUG_DISPLAY` here, as `wpdb::$show_errors` is set
 to that.

 I would suggest appending it to `$message` at the start. Also, don't
 forget to check `mysqli_error()`. :-)

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


More information about the wp-trac mailing list