From f5f32f74b966de07cda71c1bc77b66033554f9a5 Mon Sep 17 00:00:00 2001 From: Sneha Date: Tue, 28 Jul 2026 13:06:44 +0530 Subject: [PATCH] fix: use valid HTTP status 500 instead of invalid 5000 in report error 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 --- .../CustomerRelationshipSecondaryReports.java | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/main/java/com/iemr/common/controller/secondaryReport/CustomerRelationshipSecondaryReports.java b/src/main/java/com/iemr/common/controller/secondaryReport/CustomerRelationshipSecondaryReports.java index 47d73255..e6e64a6a 100644 --- a/src/main/java/com/iemr/common/controller/secondaryReport/CustomerRelationshipSecondaryReports.java +++ b/src/main/java/com/iemr/common/controller/secondaryReport/CustomerRelationshipSecondaryReports.java @@ -74,7 +74,7 @@ public ResponseEntity getQualityReport( if (e.getMessage().equalsIgnoreCase("No data found")) return ResponseEntity.status(500).body(e.getMessage()); else - return ResponseEntity.status(5000).body(e.getMessage()); + return ResponseEntity.status(500).body(e.getMessage()); } } @@ -100,7 +100,7 @@ public ResponseEntity getComplaintDetailReport( if (e.getMessage().equalsIgnoreCase("No data found")) return ResponseEntity.status(500).body(e.getMessage()); else - return ResponseEntity.status(5000).body(e.getMessage()); + return ResponseEntity.status(500).body(e.getMessage()); } } @@ -128,7 +128,7 @@ public ResponseEntity getCallSummaryReport( if (e.getMessage().equalsIgnoreCase("No data found")) return ResponseEntity.status(500).body(e.getMessage()); else - return ResponseEntity.status(5000).body(e.getMessage()); + return ResponseEntity.status(500).body(e.getMessage()); } } @@ -153,7 +153,7 @@ public ResponseEntity getAllBySexualOrientation( if (e.getMessage().equalsIgnoreCase("No data found")) return ResponseEntity.status(500).body(e.getMessage()); else - return ResponseEntity.status(5000).body(e.getMessage()); + return ResponseEntity.status(500).body(e.getMessage()); } } @@ -179,7 +179,7 @@ public ResponseEntity getDistrictWiseCallReport( if (e.getMessage().equalsIgnoreCase("No data found")) return ResponseEntity.status(500).body(e.getMessage()); else - return ResponseEntity.status(5000).body(e.getMessage()); + return ResponseEntity.status(500).body(e.getMessage()); } } @@ -203,7 +203,7 @@ public ResponseEntity getUnblockedUserReport( if (e.getMessage().equalsIgnoreCase("No data found")) return ResponseEntity.status(500).body(e.getMessage()); else - return ResponseEntity.status(5000).body(e.getMessage()); + return ResponseEntity.status(500).body(e.getMessage()); } } @@ -231,7 +231,7 @@ public ResponseEntity getCallQualityReport( if (e.getMessage().equalsIgnoreCase("No data found")) return ResponseEntity.status(500).body(e.getMessage()); else - return ResponseEntity.status(5000).body(e.getMessage()); + return ResponseEntity.status(500).body(e.getMessage()); } } @@ -258,7 +258,7 @@ public ResponseEntity getCountsByPreferredLanguage( if (e.getMessage().equalsIgnoreCase("No data found")) return ResponseEntity.status(500).body(e.getMessage()); else - return ResponseEntity.status(5000).body(e.getMessage()); + return ResponseEntity.status(500).body(e.getMessage()); } } @@ -283,7 +283,7 @@ public ResponseEntity getAllByAgeGroup( if (e.getMessage().equalsIgnoreCase("No data found")) return ResponseEntity.status(500).body(e.getMessage()); else - return ResponseEntity.status(5000).body(e.getMessage()); + return ResponseEntity.status(500).body(e.getMessage()); } } @@ -310,7 +310,7 @@ public ResponseEntity getAllReportsByDate( if (e.getMessage().equalsIgnoreCase("No data found")) return ResponseEntity.status(500).body(e.getMessage()); else - return ResponseEntity.status(5000).body(e.getMessage()); + return ResponseEntity.status(500).body(e.getMessage()); } } @@ -338,7 +338,7 @@ public ResponseEntity getAllByGender( if (e.getMessage().equalsIgnoreCase("No data found")) return ResponseEntity.status(500).body(e.getMessage()); else - return ResponseEntity.status(5000).body(e.getMessage()); + return ResponseEntity.status(500).body(e.getMessage()); } }