#30913 closed enhancement (duplicate)
Send error to error_log when creating a WP_Error object
| Reported by: | ericlewis | Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | |
| Component: | General | Version: | |
| Severity: | normal | Keywords: | |
| Cc: | Focuses: |
Description
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)
#2
@
12 years ago
- Milestone Awaiting Review
- Resolution → duplicate
- Status new → closed
#28319 looks to be covering this topic
#3
@
12 years ago
- Milestone → 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: 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.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
That would be possible with #28319.