#34915 closed enhancement (fixed)
Consider suppressing error notices for REST API requests
Reported by: | danielbachhuber | Owned by: | rachelbaker |
---|---|---|---|
Milestone: | 4.5 | Priority: | normal |
Severity: | normal | Version: | |
Component: | REST API | Keywords: | good-first-bug has-patch |
Focuses: | Cc: |
Description
We should consider suppressing error notices for REST API requests, as they can break the response.
Originally https://github.com/WP-API/WP-API/issues/477
Attachments (3)
Change History (15)
#2
in reply to:
↑ 1
@
9 years ago
Replying to chriscct7:
I actually like that they break responses right now, because it makes it easier to find bugs. If the concern is breaking responses for a production server, they could turn off notices in their PHP.ini file (which should be done on production anyways)
If this type of thing were to be considered, I would think it would make more sense to have it controlled by WP_DEBUG
. Those on hosted solutions wouldn't have control over it if it were in PHP.ini and it doesn't really make sense to separate it out from WordPress.
#3
@
9 years ago
- Keywords good-first-bug added
Looks like piggybacking on wp_debug_mode()
would be the way to go, similarly, as @nacin pointed out on GitHub, to how we suppress notices for XMLRPC requests.
#6
@
9 years ago
- Keywords needs-refresh added; needs-patch removed
@rockwell15 Thanks for your patch. It looks good, but can you refresh it to be against the svn root directory?
The location of the file being patched here should be src/wp-includes/load.php
.
This ticket was mentioned in Slack in #core-restapi by rachelbaker. View the logs.
9 years ago
#9
@
9 years ago
- Owner set to rachelbaker
- Resolution set to fixed
- Status changed from new to closed
In 36530:
I actually like that they break responses right now, because it makes it easier to find bugs. If the concern is breaking responses for a production server, they could turn off notices in their PHP.ini file (which should be done on production anyways)