From b655de3975e5c4487cd9c37e4b4065aa38c3a2ea Mon Sep 17 00:00:00 2001 From: hsiegeln <37154749+hsiegeln@users.noreply.github.com> Date: Thu, 23 Apr 2026 00:45:31 +0200 Subject: [PATCH] fix(config): structured 400 body on unknown apply value Replace empty-body ResponseEntity.status(BAD_REQUEST).build() with ResponseStatusException so Spring returns the usual error body shape with a descriptive reason string, matching the idiom used by UserAdminController, AppSettingsController, ThresholdAdminController. Co-Authored-By: Claude Opus 4.7 (1M context) --- .../server/app/controller/ApplicationConfigController.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cameleer-server-app/src/main/java/com/cameleer/server/app/controller/ApplicationConfigController.java b/cameleer-server-app/src/main/java/com/cameleer/server/app/controller/ApplicationConfigController.java index 05941123..4c037f6d 100644 --- a/cameleer-server-app/src/main/java/com/cameleer/server/app/controller/ApplicationConfigController.java +++ b/cameleer-server-app/src/main/java/com/cameleer/server/app/controller/ApplicationConfigController.java @@ -34,6 +34,7 @@ import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; import org.springframework.security.core.Authentication; import org.springframework.web.bind.annotation.*; +import org.springframework.web.server.ResponseStatusException; import java.util.ArrayList; import java.util.List; @@ -122,7 +123,8 @@ public class ApplicationConfigController { Authentication auth, HttpServletRequest httpRequest) { if (!"staged".equalsIgnoreCase(apply) && !"live".equalsIgnoreCase(apply)) { - return ResponseEntity.status(HttpStatus.BAD_REQUEST).build(); + throw new ResponseStatusException(HttpStatus.BAD_REQUEST, + "Unknown apply value '" + apply + "' — must be 'staged' or 'live'"); } String updatedBy = auth != null ? auth.getName() : "system";