protected ResponseEntity handleHttpMessageNotReadable()

in src/main/java/com/epam/digital/data/platform/excerpt/api/exception/ApplicationExceptionHandler.java [230:246]


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

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

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