Make WordPress Core

Opened 3 years ago

Last modified 21 months ago

#52011 new enhancement

'The REST API encountered an unexpected result' should be a critical error

Reported by: oglekler's profile oglekler Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version: 5.2
Component: Site Health Keywords:
Focuses: performance Cc:


I deliberately made an error by replacing one of the core files with file from a previous version (such things are happening when an update went wrong for example), which results in a PHP warning, which can be hidden if debug mode is disabled but lead to critical error from REST API and it can easily be missed in recommendations because it isn't labelled as critical.

Usually, users don't see errors which are causing through REST API, because they need to open a console firstly and they don't understand what is wrong with their site.

Attachments (1)

2020-12-10_13-08-39.png (48.3 KB) - added by oglekler 3 years ago.
The REST API encountered an unexpected result counts like recommended improvement

Download all attachments as: .zip

Change History (3)

3 years ago

The REST API encountered an unexpected result counts like recommended improvement

This ticket was mentioned in Slack in #core by oglekler. View the logs.

3 years ago

#2 @Clorith
21 months ago

  • Type changed from defect (bug) to enhancement
  • Version set to 5.2

Hmm, I'm not sure if an unexpected result should always be a critical issue, but I do believe that making it aware of a few more response types should, for example anything in the 500-range would be server errors, and should probably be flagged as critical, while below that may be due to special firewall rules and similar when performing loopback connections.

What are your thoughts on just improving it's awareness of status codes, does that sound like a good initial approach to you?

Related: #54617 which addresses the usefulness of this message response in the first place

Note: See TracTickets for help on using tickets.