Expected behavior
In case of an error during media upload, we should show the exact error to help the user take a decision.
The list of errors are defined here in Calypso. Most interesting are:
- rest_upload_limited_space
- rest_upload_file_too_big
- rest_upload_user_quota_exceeded
Note that these error codes are actually stored in the message field. Here is an sample response we get from the https://public-api.wordpress.com/rest/v1.1/sites/{SITE_ID}/media/new/ API endpoint in case of an upload on a quota limited site:
{
"error": "upload_error",
"message": "rest_upload_user_quota_exceeded|You have used your space quota. Please delete files before uploading. Back"
}
- On the network side: It would be a good idea to split the error message (something like
.split("|")), make the error code directly accessible by the UI.
- On the UI, we should handle that error and display the message correctly instead of showing a generic message. This must be done:
- In the media library.
- In the editor.
Actual behavior
We show a generic error in the editor and in the media library:
| Media Library |
Editor |
 |
 |
More details on paaHJt-17e-p2
WPAndroid related ticket: wordpress-mobile/WordPress-Android#12325
Expected behavior
In case of an error during media upload, we should show the exact error to help the user take a decision.
The list of errors are defined here in Calypso. Most interesting are:
Note that these error codes are actually stored in the message field. Here is an sample response we get from the https://public-api.wordpress.com/rest/v1.1/sites/{SITE_ID}/media/new/ API endpoint in case of an upload on a quota limited site:
.split("|")), make the error code directly accessible by the UI.Actual behavior
We show a generic error in the editor and in the media library:
More details on paaHJt-17e-p2
WPAndroid related ticket: wordpress-mobile/WordPress-Android#12325