laidig / gtfs-validator

A Java framework for GTFS validation and statistics.
MIT License
4 stars 1 forks source link

Exit code should not be 0 when the GTFS-file is not found #4

Closed Platzii closed 7 years ago

Platzii commented 7 years ago

Hi

I've found another small problem.

Right now the validator exits with status code 0 when the specified GTFS feed is not found. Same for when you do not specify the file at all. In both situations a non-zero value should be returned as exit code.


Command:

java -jar gtfs-validator.jar /data/non-existing-feed.zip

Error message:

Reading GTFS from /data/non-existing-feed.zip
Could not read file /data/non-existing-feed.zip; does it exist and is it readable?

Returned statuscode: 0


Command:

java -jar gtfs-validator.jar

Error message:

Usage: gtfs-validator /path/to/gtfs.zip

Returned statuscode: 0


Kind regards Simon

laidig commented 7 years ago

Thanks again. If you don't find anything else this week, I'll push a new release.

Platzii commented 7 years ago

Thanks for the quick reply and fix! Seems like it is working for non-existing files!

However I think this line should also be changed (if the file has not been supplied as a parameter): https://github.com/laidig/gtfs-validator/blob/9d07e2672f8c37273730163299bf4b65e310514c/gtfs-validation-lib/src/main/java/com/conveyal/gtfs/validator/ValidatorMain.java#L33

laidig commented 7 years ago

You're welcome to make a PR.