mirror of
https://github.com/mikf/gallery-dl.git
synced 2024-11-22 02:32:33 +01:00
directly pass exception instances as 'exc_info' logger argument
This commit is contained in:
parent
dd56bb2187
commit
a051e1c955
@ -45,7 +45,7 @@ class YoutubeDLDownloader(DownloaderBase):
|
||||
except (ImportError, SyntaxError) as exc:
|
||||
self.log.error("Cannot import module '%s'",
|
||||
getattr(exc, "name", ""))
|
||||
self.log.debug("", exc_info=True)
|
||||
self.log.debug("", exc_info=exc)
|
||||
self.download = lambda u, p: False
|
||||
return False
|
||||
self.ytdl_instance = ytdl_instance = ytdl.construct_YoutubeDL(
|
||||
@ -64,8 +64,8 @@ class YoutubeDLDownloader(DownloaderBase):
|
||||
if not info_dict:
|
||||
try:
|
||||
info_dict = ytdl_instance.extract_info(url[5:], download=False)
|
||||
except Exception:
|
||||
pass
|
||||
except Exception as exc:
|
||||
self.log.debug("", exc_info=exc)
|
||||
if not info_dict:
|
||||
return False
|
||||
|
||||
@ -120,8 +120,8 @@ class YoutubeDLDownloader(DownloaderBase):
|
||||
self.out.start(pathfmt.path)
|
||||
try:
|
||||
ytdl_instance.process_info(info_dict)
|
||||
except Exception:
|
||||
self.log.debug("Traceback", exc_info=True)
|
||||
except Exception as exc:
|
||||
self.log.debug("", exc_info=exc)
|
||||
return False
|
||||
return True
|
||||
|
||||
|
@ -79,7 +79,7 @@ class _8chanThreadExtractor(_8chanExtractor):
|
||||
self.cookies = self.cookies_prepare()
|
||||
except Exception as exc:
|
||||
self.log.debug("Failed to fetch captcha cookies: %s: %s",
|
||||
exc.__class__.__name__, exc, exc_info=True)
|
||||
exc.__class__.__name__, exc, exc_info=exc)
|
||||
|
||||
# download files
|
||||
posts = thread.pop("posts", ())
|
||||
|
@ -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"]
|
||||
|
@ -53,8 +53,8 @@ class NewgroundsExtractor(Extractor):
|
||||
try:
|
||||
post = self.extract_post(post_url)
|
||||
url = post.get("url")
|
||||
except Exception:
|
||||
self.log.debug("", exc_info=True)
|
||||
except Exception as exc:
|
||||
self.log.debug("", exc_info=exc)
|
||||
url = None
|
||||
|
||||
if url:
|
||||
|
@ -158,12 +158,12 @@ class Job():
|
||||
raise
|
||||
except exception.GalleryDLException as exc:
|
||||
log.error("%s: %s", exc.__class__.__name__, exc)
|
||||
log.debug("", exc_info=True)
|
||||
log.debug("", exc_info=exc)
|
||||
self.status |= exc.code
|
||||
except OSError as exc:
|
||||
log.error("Unable to download data: %s: %s",
|
||||
exc.__class__.__name__, exc)
|
||||
log.debug("", exc_info=True)
|
||||
log.debug("", exc_info=exc)
|
||||
self.status |= 128
|
||||
except Exception as exc:
|
||||
log.error(("An unexpected error occurred: %s - %s. "
|
||||
@ -171,7 +171,7 @@ class Job():
|
||||
"copy its output and report this issue on "
|
||||
"https://github.com/mikf/gallery-dl/issues ."),
|
||||
exc.__class__.__name__, exc)
|
||||
log.debug("", exc_info=True)
|
||||
log.debug("", exc_info=exc)
|
||||
self.status |= 1
|
||||
except BaseException:
|
||||
self.status |= 1
|
||||
@ -642,7 +642,7 @@ class DownloadJob(Job):
|
||||
except Exception as exc:
|
||||
pp_log.error("'%s' initialization failed: %s: %s",
|
||||
name, exc.__class__.__name__, exc)
|
||||
pp_log.debug("", exc_info=True)
|
||||
pp_log.debug("", exc_info=exc)
|
||||
else:
|
||||
pp_list.append(pp_obj)
|
||||
|
||||
|
@ -223,11 +223,12 @@ class UgoiraPP(PostProcessor):
|
||||
print()
|
||||
self.log.error("Unable to invoke FFmpeg (%s: %s)",
|
||||
exc.__class__.__name__, exc)
|
||||
self.log.debug("", exc_info=exc)
|
||||
pathfmt.realpath = pathfmt.temppath
|
||||
except Exception as exc:
|
||||
print()
|
||||
self.log.error("%s: %s", exc.__class__.__name__, exc)
|
||||
self.log.debug("", exc_info=True)
|
||||
self.log.debug("", exc_info=exc)
|
||||
pathfmt.realpath = pathfmt.temppath
|
||||
else:
|
||||
if self.mtime:
|
||||
|
Loading…
Reference in New Issue
Block a user