Skip to content

Commit

Permalink
Fail transfer instantly if a job cannot be fetched
Browse files Browse the repository at this point in the history
  • Loading branch information
aksingh737 committed Jan 11, 2024
1 parent 85735b2 commit 03a07ec
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
package org.datatransferproject.transfer.copier;

import com.google.cloud.datastore.DatastoreException;
import com.google.common.base.Preconditions;
import com.google.common.base.Stopwatch;
import com.google.inject.Provider;
import java.io.IOException;
Expand Down Expand Up @@ -125,6 +126,8 @@ protected ExportResult<?> copyIteration(
DataModel exportedData = exportResult.getExportedData();
if (exportedData != null) {
PortabilityJob job = jobStore.findJob(jobId);
Preconditions.checkNotNull(job, "Transfer cannot proceed without fetching the job. "
+ "Something in very wrong so halting the transfer.");
TransferMode transferMode =
job == null ? TransferMode.DATA_TRANSFER : job.transferMode();
switch (transferMode) {
Expand Down

0 comments on commit 03a07ec

Please sign in to comment.