In cases where we can, we should give the user a clear understanding of what is causing the error i.e., we should add specific error cases where possible and sensible.
Currently, users receive a 500 Unexpected error when they send an edit that exceeds the entity size limit. The entity size limit is configurable per Wikibase.
Acceptance criteria:
- HTTP status code: 400
- Error response:
{ "code": "resource-too-large", "message": "edit resulted in a resource that exceeds the size limit of {configured-limit}", "context": { "limit": {configured-limit-as-int} } }
- Notes:
- If we can't easily use a human readable size in the message use "{configured-limit} bytes" instead
- If we can't easily have an integer context limit, use the string interpretation instead
Alternative codes considered: "result-too-large"Alternative messages considered: "Edit result exceeds confiured limit {configured-limit}", "edit resulted in a resource that is too large"- Configure the limit number to kB.
- This would be working for PATCH requests as well, with the same error code and response.