Skip to content

Commit

Permalink
Fail properly if things can't be resolved in transitland-atlas
Browse files Browse the repository at this point in the history
  • Loading branch information
jbruechert committed Apr 26, 2024
1 parent bf4172c commit 11a2bb1
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/fetch.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def fetch_source(self, dest_path: Path, source: Source) -> bool:
case TransitlandSource():
http_source = self.transitland_atlas.source_by_id(source)
if not http_source:
return False
sys.exit(1)

return self.fetch_source(dest_path, http_source)
case HttpSource():
Expand All @@ -68,7 +68,8 @@ def fetch_source(self, dest_path: Path, source: Source) -> bool:

# Fetch last modification time from the server
server_headers = \
requests.head(download_url, headers=source.options.headers, allow_redirects=True).headers
requests.head(download_url, headers=source.options.headers,
allow_redirects=True).headers

# If server version is older, return
last_modified_server = None
Expand Down

0 comments on commit 11a2bb1

Please sign in to comment.