Why this matters
Correct semantics enable predictable client handling and monitoring.
API endpoints should return an explicit status code and minimal error body on failures; avoid 200 with error payload.
Correct semantics enable predictable client handling and monitoring.
Side-by-side examples engineers can pattern-match during review.
return ok(new ErrorPayload("failed")); // 200 with errorreturn httpResponse(500, Map.of("error", "internal_error"));return ok(Map.of("error","x"))return response(400, Map.of("error","invalid_request"))From the same buckets as this rule.