User tests: Successful: Unsuccessful:
Pull Request for Issue #45962
Throw a 404 instead of a 500
500 thrown
404 thrown
Please select:
Documentation link for docs.joomla.org:
No documentation changes for docs.joomla.org needed
Pull Request link for manual.joomla.org:
No documentation changes for manual.joomla.org needed
Status | New | ⇒ | Pending |
... and I think that the general error handling of the JsonapiRenderer needs a serious refactoring as it's currently impossible to define an status code from an application level, you have to rely on the pre-defined handlers and their hardcoded codes.
Hmm, 409 indeed seems more suitable than 404.
As I said: the API does not allow custom status codes. Specific exceptions are associated with specific codes. We would have to add a new exception type for a 409, which just builds yet another layer on this insufficient base design. I’m not doing this in my PR. Either use it or propose an alternate approach.
I'm ok with that. As the Rolling Stones sang: You can't always get what you want :-)
Labels |
Added:
PBF
PR-5.4-dev
|
I have tested this item ✅ successfully on 0cd8e66
Received a 404 after the patch.
I have tested this item ✅ successfully on 0cd8e66
I have tested this successfully with Tim ;) Thanks @SniperSister!
Status | Pending | ⇒ | Ready to Commit |
RTC
Labels |
Added:
RTC
|
✅ Final test before merge, using public instance with manual installation
curl -H 'X-JUpdate-Token: 4711' 'https://joomla-test.heikol.de/api/index.php/v1/joomlaupdate/healthcheck'
{"errors":[{"code":500,"title":"Internal server error"}]}%
{"errors":[{"title":"Resource not found","code":404}]}%
Status | Ready to Commit | ⇒ | Fixed in Code Base |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2025-08-23 12:46:37 |
Closed_By | ⇒ | muhme |
Thank you @SniperSister for your contribution. Thank you @HLeithner and @richard67 for supporting this issue. Thank you @rbuelund and @exlemor for testing.
409 would fit better I think