private void validateResponseOrThrow(Response response, String operationName) {
    if (response == null) {
      logger.error(operationName + ": not expecting null response");
      throw new FileCopyHandlerException(operationName + ": not expecting null response",
          FileCopyHandlerException.FileCopyHandlerErrorCode.UnknownError);
    }
    if (response.getError() != ServerErrorCode.NoError) {
      logger.error(operationName + ": not expecting error response");
      throw new FileCopyHandlerException(operationName + ": not expecting error response",
          FileCopyHandlerException.FileCopyHandlerErrorCode.UnknownError);
    }
  }
Validate the response or throw a FileCopyHandlerException.
@param response the response to validate
@param operationName the operation name
ambry-file-transfer/src/main/java/com/github/ambry/filetransfer/handler/StoreFileCopyHandler.java