Implemented a Global Exception Handler using @ControllerAdvice to manage common excep... 83/140983/1
authorsourabh_sourabh <sourabh.sourabh@est.tech>
Wed, 28 May 2025 13:55:30 +0000 (14:55 +0100)
committersourabh_sourabh <sourabh.sourabh@est.tech>
Wed, 28 May 2025 13:55:30 +0000 (14:55 +0100)
commit15b74d92614bbbf8b3badd27867c4e3d45d45f51
tree3752fcf28e370a47ed5dca376fdcde28834df059
parent79d279aa7771dfabee37ac24c0f84d35e39c76c0
Implemented a Global Exception Handler using @ControllerAdvice to manage common exceptions across the application.

- Handles validation errors (MethodArgumentNotValidException) with detailed field error responses.
- Handles missing request parameters (MissingServletRequestParameterException) with clear error messages.
- Catches all other uncaught exceptions and returns a generic internal server error response.
- This improves error consistency, observability, and simplifies controller logic.

Issue-ID: CPS-2827
Change-Id: I702ca917d71af997a5743288732dbc1c91ee2798
Signed-off-by: sourabh_sourabh <sourabh.sourabh@est.tech>
dmi-stub/dmi-stub-service/src/main/java/org/onap/cps/ncmp/dmi/rest/stub/exception/DmiRestStubExceptionHandler.java [new file with mode: 0644]