Description
Steps to reproduce (step by step instructions, with links, commands and necessary data to reproduce the error)
Observed behavior
When running the call, the following error is generated:
{
"Z1K1": "Z5",
"Z5K1": "Z526",
"Z5K2": {
"Z1K1": {
"Z1K1": "Z7",
"Z7K1": "Z885",
"Z885K1": "Z526"
},
"K1": {
"Z1K1": "Z39",
"Z39K1": "Z14K2"
},
"K2": {
"Z1K1": "Z5",
"Z5K1": "Z526",
"Z5K2": {
"Z1K1": {
"Z1K1": "Z7",
"Z7K1": "Z885",
"Z885K1": "Z526"
},
"K1": {
"Z1K1": "Z39",
"Z39K1": "Z802K2"
},
"K2": {
"Z1K1": "Z5",
"Z5K1": "Z537",
"Z5K2": {
"Z1K1": {
"Z1K1": "Z7",
"Z7K1": "Z885",
"Z885K1": "Z537"
},
"K1": null
}
}
}
}
}
}Which is a non valid ZObject as it has "K1": null key
When this object is being converted into human readable format, it returns an exception, and instead of handling this exception and returning an empty object, the exception is passed as response to the API:
from /var/www/html/w/extensions/WikiLambda/includes/ZObjectUtils.php(1006)
Expected behavior/Acceptance criteria (returned value, expected error, performance expectations, etc.)
Multiple things to fix in here:
- Creation of error Z537 (invalid reference) is not working, as it's assigning null as the error instance. This must be fixed in the ZErrorFactory.
- Creation of human readable object when the error is incorrect, should not send the exception as a response to the API. Instead, it should return the minimum available information found about the error.
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#Back-end_Task/Bug_completion_checklist