Consider using REST API data for database errors. #64158
Labels
[Package] Editor
/packages/editor
[Status] In Progress
Tracking issues with work in progress
[Type] Enhancement
A suggestion for improvement.
What problem does this address?
Currently saving errors in the database show the generic error message: Updating failed. Could not update post in the database.
While the message explains what happened, it provides no indication of how the user can fix it.
What is your proposed solution?
The REST API response includes further details about the field or fields that caused the error: WordPress database error: Processing the value for the following field failed: %s. The supplied value may be too long or contains invalid data.
Using the additional data could be helpful in providing users with an indication of why the database error occurred.
While the main portion of the content is translated, the field or fields that caused the error to occur are not (all sites use English for the database table names). So it's possible some work would need to be done to make the error messages more useful for non-English sites.
Props @ramonjd for the suggestion in #64155
The text was updated successfully, but these errors were encountered: