private ConstraintViolationException constraintViolationException()

in ddm-data-factory-feign-config/src/main/java/com/epam/digital/data/platform/datafactory/feign/decoder/DataFactoryErrorDecoder.java [98:107]


  private ConstraintViolationException constraintViolationException(Response response) {
    var systemErrorDto = objectMapper
        .readValue(response.body().asInputStream(), SystemErrorDto.class);

    var dataFactoryError = DataFactoryError.fromNameOrDefaultRuntimeError(systemErrorDto.getCode());
    var localizedMessage = messageResolver.getMessage(dataFactoryError.getTitleKey());

    systemErrorDto.setLocalizedMessage(localizedMessage);
    return new ConstraintViolationException(systemErrorDto);
  }