r-transit / gtfsio

Read and Write General Transit Feed Specification (GTFS)
https://r-transit.github.io/gtfsio/
Other
13 stars 3 forks source link

Error or warning when feed doesn't contain the specified file #4

Closed rafapereirabr closed 3 years ago

rafapereirabr commented 3 years ago

I'm writting a few tests for the import_gtfs() fun and I've encountered the behavior below:

This will read the GTFS and throw a warning:

library(gtfsio)

import_gtfs(path = gtfszip, files = c('aaa','stops'))

Warning message: In import_gtfs(path = gtfszip, files = c("aaa", "stops")) : The provided GTFS feed doesn't contain the following text file(s): 'aaa'

This will read the GTFS and throw and Error AND a warning:

import_gtfs(path = gtfszip, files = 'aaa')

Error in import_gtfs(path = gtfszip, files = "aaa") : The provided GTFS feed doesn't contain any of the specified files. In addition: Warning message: In import_gtfs(path = gtfszip, files = "aaa") : The provided GTFS feed doesn't contain the following text file(s): 'aaa'

I'm just wondering if this shouldn't throw an ERROR in both cases. What do you guys think?

dhersz commented 3 years ago

Hi Rafa, I've opened a discussion related to this issue. Check it out.