Skip to content

Commit

Permalink
fix(NormalizeFieldTr...): Handle ZIP exceptions with specific error m…
Browse files Browse the repository at this point in the history
…essage.
  • Loading branch information
binh-dam-ibigroup committed Jun 6, 2024
1 parent f384d6d commit 9826e97
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;
import java.util.zip.ZipException;
import java.util.zip.ZipFile;

import static com.conveyal.datatools.manager.DataManager.getConfigProperty;
Expand Down Expand Up @@ -219,6 +220,11 @@ public void transform(FeedTransformZipTarget zipTarget, MonitorableJob.Status st
// (This should also trigger a system IO update event, so subsequent IO calls pick up the correct file.
Files.move(tempZipPath, originalZipPath, StandardCopyOption.REPLACE_EXISTING);
LOG.info("Field normalization transformation successful, {} row(s) changed.", modifiedRowCount);
} catch (ZipException ze) {
status.fail(
String.format("'Normalize Field' failed because the GTFS archive is corrupted (%s).", ze.getMessage()),
ze
);
} catch (Exception e) {
status.fail("Unknown error encountered while transforming zip file", e);
}
Expand Down

0 comments on commit 9826e97

Please sign in to comment.