[wp-trac] [WordPress Trac] #28319: Add hook to WP_Error for logging and report purposes

WordPress Trac noreply at wordpress.org
Sat Jul 12 18:46:48 UTC 2014


#28319: Add hook to WP_Error for logging and report purposes
-------------------------------------------+-----------------------------
 Reporter:  ebinnion                       |       Owner:  johnbillion
     Type:  enhancement                    |      Status:  reopened
 Priority:  normal                         |   Milestone:  Future Release
Component:  General                        |     Version:  trunk
 Severity:  normal                         |  Resolution:
 Keywords:  reporter-feedback 2nd-opinion  |     Focuses:
-------------------------------------------+-----------------------------

Comment (by danielbachhuber):

 > This is basically the equivalent of logging every time a function
 returns false.

 I disagree. Creating a `WP_Error` object is a deliberate decision of the
 developer to report an error upstream. Returning false is for a valid
 condition.

 > My initial use case came came from my code wrangler trial. I was tasked
 with creating a message/error logging API.

 Funny enough, I set about doing a similar thing on WordPress.com — track
 instances in which users run into application errors. You might find some
 thread via MGS about it. I didn't end up producing anything because there
 isn't an action in `WP_Error`.

 +1 generally to the idea of adding an action.

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


More information about the wp-trac mailing list