directly pass exception instances as 'exc_info' logger argument

This commit is contained in:
Mike Fährmann
2024-09-19 14:50:08 +02:00
parent dd56bb2187
commit a051e1c955
6 changed files with 18 additions and 15 deletions

View File

@@ -37,11 +37,13 @@ class FlickrExtractor(Extractor):
extract = self.api._extract_format
for photo in self.photos():
try:
1/0
photo = extract(photo)
except Exception as exc:
self.log.warning(
"Skipping %s (%s)", photo["id"], exc.__class__.__name__)
self.log.debug("", exc_info=True)
"Skipping photo %s (%s: %s)",
photo["id"], exc.__class__.__name__, exc)
self.log.debug("", exc_info=exc)
else:
photo.update(data)
url = photo["url"]