WordPress.org

Make WordPress Core

Changes between Version 1 and Version 2 of Ticket #28319, comment 23


Ignore:
Timestamp:
11/23/2014 11:25:39 PM (7 years ago)
Author:
carlalexander
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #28319, comment 23

    v1 v2  
    99This means that not all WP_Errors are equal. I took a stab at trying to figure that out last year (http://carlalexander.ca/diving-into-wordpress-errors/). The main conclusion was that there was no easy way to track them down without checking every hook WordPress. You'd then need data after to see which ones are relevant or not.
    1010
    11 On top of that, WP_Errors are not always self contained. The most specific example is the http_api_debug hook. The WP_Error sent by the hook is not as useful without other variables passed in the hook. That means that any hook in the WP_Error object (on add or construct) isn't very useful besides for tracking a message. You lack contextual information.
     11On top of that, WP_Errors are not always self contained. The most specific example is the http_api_debug hook. The WP_Error sent by the hook isn't as useful without other variables passed in the hook. That means that any hook in the WP_Error object (on add or construct) isn't very useful besides for tracking a message. You lack contextual information.
    1212
    1313> The REST API will make pretty liberal use of WP_Error (intentionally), and logging all of those alone would be problematic.