protected ResponseEntity handleHttpMessageNotReadable()

in src/main/java/com/epam/digital/data/platform/restapi/core/exception/ApplicationExceptionHandler.java [210:224]


  protected ResponseEntity<Object> handleHttpMessageNotReadable(
      HttpMessageNotReadableException exception, HttpHeaders headers, HttpStatus status,
      WebRequest request) {

    var parseException = handleParseException(exception, ResponseCode.VALIDATION_ERROR);
    if (parseException.isPresent()) {
      log.error("Can not read some of arguments", exception);
      return ResponseEntity.status(HttpStatus.UNPROCESSABLE_ENTITY)
          .body(parseException.get());
    }

    log.error("Request body is not readable JSON", exception);
    return ResponseEntity.status(HttpStatus.BAD_REQUEST)
        .body(newDetailedResponse(ResponseCode.CLIENT_ERROR));
  }