- Modify the use case to use exceptions instead of response objects
- Modify validators by:
- Move the validation logic into the validator, in a new method assertValidRequest
- Throw a UseCaseException inside the new method
- Modify related route handler
- Since there is now only one response for use cases (the SuccessResponse), we will rename it to just Response
- Modify related tests
Description
Description
Details
Details
Related Changes in Gerrit:
| Subject | Author | Repo | Branch | Lines +/- | |
|---|---|---|---|---|---|
| REST: Modify PatchItemStatement to throw exceptions | Ollie Shotton | mediawiki/extensions/Wikibase | master | +495 -520 |
| Status | Subtype | Assigned | Task | ||
|---|---|---|---|---|---|
| Resolved | • Muhammad_Yasser_Jazirahly_WMDE | T327527 Should our use cases throw exceptions instead of returning different response objects? | |||
| Resolved | WMDE-leszek | T329947 🚨 Use exceptions instead of response objects in previous use cases | |||
| Resolved | • Muhammad_Yasser_Jazirahly_WMDE | T330140 🚨 Modify PatchItemStatement |
Event Timeline
Comment Actions
Change 891864 had a related patch set uploaded (by Ollie Shotton; author: Ollie Shotton):
[mediawiki/extensions/Wikibase@master] [WIP] REST: Modify PatchItemStatement to throw exceptions
Comment Actions
Change 891864 merged by jenkins-bot:
[mediawiki/extensions/Wikibase@master] REST: Modify PatchItemStatement to throw exceptions