@transportme/load-ptv-gtfs 1.4.35 → 1.4.36

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -21,22 +21,31 @@ export default class GTFSCalendarReader extends GTFSReader {
21
21
  this.#calendarDateFile = calendarDateFile
22
22
  }
23
23
 
24
+ #checkMissingFile(e) {
25
+ if (!e.stack.includes('ENOENT')) throw e
26
+ }
27
+
24
28
  async open() {
25
29
  try {
26
30
  await super.open()
27
- } catch (e) { this.#hasCalendar = false }
31
+ } catch (e) {
32
+ this.#checkMissingFile(e)
33
+ this.#hasCalendar = false
34
+ }
28
35
 
29
36
  if (!this.#calendarDateFile) return
30
- let calendarDateReader = new GTFSCalendarDateReader(this.#calendarDateFile)
31
- await calendarDateReader.open()
32
- while (calendarDateReader.available()) {
33
- let calendarDate = await calendarDateReader.getNextEntity()
34
- if (!this.#calendarDates[calendarDate.id]) {
35
- this.#calendarDates[calendarDate.id] = []
36
- this.#unprocessedCalendarDates.add(calendarDate.id)
37
+ try {
38
+ let calendarDateReader = new GTFSCalendarDateReader(this.#calendarDateFile)
39
+ await calendarDateReader.open()
40
+ while (calendarDateReader.available()) {
41
+ let calendarDate = await calendarDateReader.getNextEntity()
42
+ if (!this.#calendarDates[calendarDate.id]) {
43
+ this.#calendarDates[calendarDate.id] = []
44
+ this.#unprocessedCalendarDates.add(calendarDate.id)
45
+ }
46
+ this.#calendarDates[calendarDate.id].push(calendarDate)
37
47
  }
38
- this.#calendarDates[calendarDate.id].push(calendarDate)
39
- }
48
+ } catch (e) { this.#checkMissingFile(e) }
40
49
  }
41
50
 
42
51
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@transportme/load-ptv-gtfs",
3
- "version": "1.4.35",
3
+ "version": "1.4.36",
4
4
  "description": "",
5
5
  "main": "index.mjs",
6
6
  "scripts": {