int getPartNumber(Part part) throws RestServiceException {
    try {
      return part.getPartNumber();
    } catch (NumberFormatException e) {
      // cannot use getPartNumber() here as it would cause another exception
      String error = String.format(S3Constants.ERR_INVALID_PART_NUMBER, part);
      throw new RestServiceException(error, RestServiceErrorCode.BadRequest);
    } catch (Throwable e) {
      // any other exception is invalid
      throw new RestServiceException(S3Constants.ERR_INVALID_MULTIPART_UPLOAD, RestServiceErrorCode.BadRequest);
    }
  }
Get the part number from the part object
@param part
@return
@throws RestServiceException
ambry-frontend/src/main/java/com/github/ambry/frontend/s3/S3MultipartCompleteUploadHandler.java