Skip to content

fix: use valid HTTP status 500 instead of invalid 5000 in report error responses - #448

Merged
vishwab1 merged 1 commit into
release-3.9.0from
fix/report-status-code-5000
Aug 19, 2026
Merged

fix: use valid HTTP status 500 instead of invalid 5000 in report error responses#448
vishwab1 merged 1 commit into
release-3.9.0from
fix/report-status-code-5000

Conversation

@snehar-nd

Copy link
Copy Markdown
Contributor

Summary

  • CustomerRelationshipSecondaryReports returned ResponseEntity.status(5000) on generic exceptions across all secondary report endpoints (including getAllByGender and getAllBySexualOrientation, used by the 1097 report downloads).
  • 5000 is not a valid three-digit HTTP status, so Spring throws IllegalArgumentException while building the response. That exception is caught by the global ValidationExceptionHandler, which surfaces a confusing "Status code '5000' should be a three-digit positive integer" error instead of the actual failure reason, with an HTTP 400.
  • Reproduced on UAT (uatamrit.piramalswasthya.org) via POST /common-api/crmReports/getAllBySexualOrientation.

Fix

Replace ResponseEntity.status(5000) with ResponseEntity.status(500) in every generic-exception branch of the affected report endpoints, matching the existing "No data found" branch which already used a valid 500.

Test plan

  • Deploy to UAT and re-run POST /common-api/crmReports/getAllBySexualOrientation with a payload that previously triggered the generic-exception branch; confirm a clean 500 with the real error message instead of the malformed 5000/400 response.
  • Spot-check the other affected endpoints in this controller (getAllByGender, etc.) for the same fix.

…r responses

CustomerRelationshipSecondaryReports controller returned ResponseEntity.status(5000)
on generic exceptions across all report endpoints (including getAllByGender and
getAllBySexualOrientation used by the 1097 report downloads). 5000 is not a valid
three-digit HTTP status, so Spring throws IllegalArgumentException while building
the response, which surfaces to clients as a confusing
"Status code '5000' should be a three-digit positive integer" error instead of the
actual failure reason.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 8352fe08-19a2-44cf-a1e9-861acdcbe455

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@sonarqubecloud

Copy link
Copy Markdown

@snehar-nd
snehar-nd changed the base branch from develop to release-3.9.0 August 19, 2026 11:47
@vishwab1
vishwab1 merged commit e88fe3b into release-3.9.0 Aug 19, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants