Skip to content
Snippets Groups Projects
Verified Commit dfe40fa4 authored by Marco Aceti's avatar Marco Aceti
Browse files

Handle general exceptions

parent 1de9d29c
Branches
No related tags found
No related merge requests found
Pipeline #2642 passed
......@@ -69,7 +69,12 @@ def main() -> None:
_fetched_trains_delete_later: list[int] = list()
for unfetched_train_hash in tqdm(unfetched_trains):
train = unfetched_trains[unfetched_train_hash]
try:
train.fetch()
except Exception as e:
logging.exception(e)
continue
if train._phantom or train.arrived():
fetched_trains[unfetched_train_hash] = train
logging.debug(f"Saved previously unfetched {train.category} {train.number}")
......@@ -89,7 +94,12 @@ def main() -> None:
if hash(train) in fetched_trains or hash(train) in unfetched_trains:
continue
try:
train.fetch()
except Exception as e:
logging.exception(e)
continue
if train._phantom or train.arrived():
fetched_trains[hash(train)] = train
logging.debug(f"Saved {train.category} {train.number}")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment