1
0
Fork 0

Handle PreDB DNS errors

This commit is contained in:
Casper V. Kristensen 2022-11-28 19:39:20 +01:00
parent 4d12e84ce2
commit 4e9219b461

View file

@ -1,7 +1,7 @@
import logging import logging
from datetime import datetime from datetime import datetime
from typing import NamedTuple, List from typing import NamedTuple, List
from urllib.error import HTTPError from urllib.error import HTTPError, URLError
from . import cache from . import cache
@ -25,7 +25,7 @@ def get_pres() -> List[Pre]:
pres.update( pres.update(
(p.dirname, p) for p in get() (p.dirname, p) for p in get()
) # override duplicate dirnames in later iterations ) # override duplicate dirnames in later iterations
except HTTPError as e: except (HTTPError, URLError) as e:
logger.error(e) logger.error(e)
logger.warning("Connection to predb failed, skipping..") logger.warning("Connection to predb failed, skipping..")