use of py.org.fundacionparaguaya.pspserver.common.dtos.FieldErrorDTO in project FP-PSP-SERVER by FundacionParaguaya.
the class ExceptionTranslatorAdvice method handleCustomParameterizedValidationError.
@ExceptionHandler(CustomParameterizedException.class)
public ResponseEntity<Object> handleCustomParameterizedValidationError(CustomParameterizedException ex) {
List<FieldErrorDTO> fieldErrors = ex.getFieldErrors();
ErrorDTO dto = ErrorDTO.of(ex.getLocalizedMessage());
dto.addFieldErrors(fieldErrors);
return generateResponseEntity(dto, HttpStatus.BAD_REQUEST);
}
Aggregations