Package com.onec.ui
Class OnecValidationExceptionHandler
java.lang.Object
com.onec.ui.OnecValidationExceptionHandler
Maps the framework's
ValidationException (a missing required attribute, an out-of-range /
malformed value, or a failed business rule) to HTTP 400 with a small JSON body, so a client-input
error reads as a Bad Request instead of a 500 (issue #32). Applies application-wide, so it also
covers app-written controllers and public intake endpoints that persist via the repository.
When the failure carries per-field detail it's emitted as fieldErrors (and any
cross-field messages as formErrors), which the edit form maps onto the right inputs.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription
-
Constructor Details
-
OnecValidationExceptionHandler
public OnecValidationExceptionHandler()
-
-
Method Details
-
handle
@ExceptionHandler(ValidationException.class) public org.springframework.http.ResponseEntity<Map<String,Object>> handle(ValidationException ex)
-