fix: correct BAD_REQUEST status code and deduplicate exception codes in OutputResponse#212
Conversation
…in OutputResponse
|
Warning Rate limit exceeded
You’ve run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
|
Hi @drtechie and @sharma-sugurthi, While working on the HTTP status fix in #153, found these incorrect constants in OutputResponse.java:
1 file, 3 line fix but affects every controller in HWC-API. |
|



📋 Description
Fixes incorrect HTTP status code constants in OutputResponse.java that affect every API response across HWC-API.
Problem 1: BAD_REQUEST = 404
BAD_REQUESTwas set to404(Not Found) instead of400(Bad Request). This caused every bad request response to carry the semantically wrong HTTP status code, making it impossible to distinguish "resource not found" from "malformed request" errors.Problem 2: Duplicate exception codes
SWYMED_EXCEPTIONandTM_EXCEPTIONboth used error code5010, making them completely indistinguishable in logs and error tracking systems.Related to PSMRI/AMRIT#153
✅ Type of Change
ℹ️ Additional Information
Changes — 1 file, 3 lines:
BAD_REQUEST: 404 → 400SWYMED_EXCEPTION: 5010 → 5008TM_EXCEPTION: 5010 → 5009These constants are used across 20+ controllers in HWC-API.