[wp-trac] [WordPress Trac] #30913: Send error to error_log when creating a WP_Error object

WordPress Trac noreply at wordpress.org
Mon Jan 5 16:00:48 UTC 2015


#30913: Send error to error_log when creating a WP_Error object
-------------------------+------------------------------
 Reporter:  ericlewis    |       Owner:
     Type:  enhancement  |      Status:  closed
 Priority:  normal       |   Milestone:  Awaiting Review
Component:  General      |     Version:
 Severity:  normal       |  Resolution:  duplicate
 Keywords:               |     Focuses:
-------------------------+------------------------------
Changes (by nacin):

 * milestone:   => Awaiting Review


Comment:

 As noted in #28319:
 > I think my bigger concern here is that WP_Error objects are not
 exceptions — rarely are they "exceptional." Often, they are used as return
 values for functions that meet some kind of error condition, but that
 doesn't mean every usage meets the level of a deprecated function,
 notices, or PHP errors (see also: https://wordpress.org/plugins/log-
 deprecated-notices/, https://wordpress.org/plugins/debug-bar/).
 > This is basically the equivalent of logging every time a function
 returns false.

 I think there are better things we can do here. I'm writing something up
 this week.

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


More information about the wp-trac mailing list