Package com.onec.ui

Class OnecValidationExceptionHandler

java.lang.Object
com.onec.ui.OnecValidationExceptionHandler

@RestControllerAdvice public class OnecValidationExceptionHandler extends Object
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.