Make WordPress Core

Opened 8 years ago

Closed 8 years ago

Last modified 8 years ago

#30913 closed enhancement (duplicate)

Send error to error_log when creating a WP_Error object

Reported by: ericlewis's profile ericlewis Owned by:
Milestone: Priority: normal
Severity: normal Version:
Component: General Keywords:
Focuses: Cc:


WP_Error is a generic error object for the WordPress application.

To assist with debugging, I'd like us to consider sending these error messages to PHP's error_log() function.

Change History (4)

#1 @ocean90
8 years ago

That would be possible with #28319.

#2 @ericlewis
8 years ago

  • Milestone Awaiting Review deleted
  • Resolution set to duplicate
  • Status changed from new to closed

#28319 looks to be covering this topic well enough, thanks ocean90!

Last edited 8 years ago by ericlewis (previous) (diff)

#3 @nacin
8 years ago

  • Milestone set to Awaiting Review

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:,
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.

#4 @nacin
8 years ago

  • Milestone Awaiting Review deleted
Note: See TracTickets for help on using tickets.