This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
JSON error responses should have relevant HTTP status codes #3890
Labels
content administration 🤓
features related to content administration
enhancement
improvements to existing features
Throughout Craft's controllers, anywhere that returns JSON with errors, the response is a 200.
It really should be 4xx or 5xx, so it can be properly handled.
A good solution might be to add this to
craft\web\Controller::asErrorJson
, and use that more universally.I'm thinking something like this might be ideal:
Or perhaps something else to unify all JSON responses (success, error, errors, message, etc: #2495)
The text was updated successfully, but these errors were encountered: