Opened 8 months ago
Last modified 3 days ago
#22115 new enhancement
Further Simplifying errors
| Reported by: |
|
Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | Future Release |
| Component: | Database | Version: | 3.4.2 |
| Severity: | normal | Keywords: | 2nd-opinion dev-feedback has-patch |
| Cc: | msolution |
Description
tracking errors while making API's and cron jobs, is a tad difficult.
from the latest wordpress pack, /includes/wp-db.php
function query( $query ) {
...
...
if ( defined( 'SAVEQUERIES' ) && SAVEQUERIES )
$this->queries[] = array( $query, $this->timer_stop(), $this->get_caller() );
// If there is an error then take note of it..
if ( $this->last_error = mysql_error( $this->dbh ) ) {
$this->print_error();
return false;
}
...
...
if we change the above to simply
// If there is an error then take note of it.. $this->last_error = ''; if ( $this->last_error = mysql_error( $this->dbh ) ) $this->print_error(); if ( defined( 'SAVEQUERIES' ) && SAVEQUERIES ) $this->queries[] = array( $query, $this->timer_stop(), $this->get_caller(), $this->last_error ); // If there is an error then take note of it.. if ( ! empty( $this->last_error ) ) return false;
then we have all required info in the array queries, for use later. may it be wp_footer, or for a plugin as debug info.
Attachments (1)
Change History (5)
SergeyBiryukov — 7 months ago
comment:1
SergeyBiryukov — 7 months ago
- Keywords has-patch added
comment:2
SergeyBiryukov — 5 months ago
- Milestone changed from Awaiting Review to 3.6
comment:3
SergeyBiryukov — 5 months ago
- Type changed from feature request to enhancement
Note: See
TracTickets for help on using
tickets.
