Description
Before, the API error responses were:
{ "error": { "code": "wikilambda-zerror", "info": "Error of type Z554", "message": "Label for a given language clashes with another Object's label", "zerror": { ... }, "labelled": { ... } } }
After this change https://gerrit.wikimedia.org/r/c/mediawiki/extensions/WikiLambda/+/1015290 the responses are:
{ "xhr": { "readyState": 4, "responseText": "{\"error\":{\"code\":\"wikilambda-zerror\",\"info\":\"Error of type Z554\",\"message\":\"Label for a given language clashes with another Object's label\",\"zerror\":{\"Z1K1\":\"Z5\",\"Z5K1\":\"Z554\",\"Z5K2\":{\"Z1K1\":{\"Z1K1\":\"Z7\",\"Z7K1\":\"Z885\",\"Z885K1\":\"Z554\"},\"K1\":{\"Z1K1\":\"Z6\",\"Z6K1\":\"Z10000\"},\"K2\":{\"Z1K1\":\"Z6\",\"Z6K1\":\"Z1002\"}}},\"labelled\":{\"type\":\"Error\",\"error type\":\"Label for a given language clashes with another Object's label\",\"error value\":{\"type\":{\"type\":\"Function call\",\"function\":\"Errortype to type\",\"errortype\":\"Label for a given language clashes with another Object's label\"},\"clashing ZID\":{\"type\":\"String\",\"value\":\"Date\"},\"language\":{\"type\":\"String\",\"value\":\"English\"}}},\"*\":\"See http://localhost:8080/w/api.php for API usage. Subscribe to the mediawiki-api-announce mailing list at <https://lists.wikimedia.org/postorius/lists/mediawiki-api-announce.lists.wikimedia.org/> for notice of API deprecations and breaking changes.\"},\"servedby\":\"49744f6ca153\"}", "responseJSON": { "error": { "code": "wikilambda-zerror", "info": "Error of type Z554", "message": "Label for a given language clashes with another Object's label", "zerror": {}, "labeled": {} } } } }
We need to adapt all the front-end error handling to this change in the failure response.
Completion checklist
- Before closing this task, review one by one the checklist available here: https://www.mediawiki.org/wiki/Abstract_Wikipedia_team/Definition_of_Done#Front-end_Task/Bug_Completion_Checklist