update error message for unspecified exceptions

- ask user to report unexpected errors, which usually indicate
  extractor failure
- handle OSErrors separately (permissions, disk full, etc)
- revert 30eef52
pull/40/head
Mike Fährmann 7 years ago
parent 7e936e9c06
commit cfa479fab5
No known key found for this signature in database
GPG Key ID: 5680CA389D365A88

@ -17,7 +17,6 @@ class JaiminisboxChapterExtractor(foolslide.FoolslideChapterExtractor):
pattern = foolslide.chapter_pattern(r"(?:www\.)?jaiminisbox\.com/reader")
test = [
("https://jaiminisbox.com/reader/read/uratarou/en/0/1/", {
"url": "f021de7f31ee3a3f688fdf3e8183aef4226c2b50",
"keyword": "d187df3e3b6dbe09ec163626f6fd7c57133ab163",
}),
("https://jaiminisbox.com/reader/read/dr-stone/en/0/16/", {

@ -74,8 +74,7 @@ class SeigaUserExtractor(SeigaExtractor):
r"user/illust/(\d+)")]
test = [
("http://seiga.nicovideo.jp/user/illust/39537793", {
"keyword": "66b3309484417fb5e76b72d5bd64526fa5d9b6a3",
"content": "40dc3b454d429108cb834b9e449229231010ddfa",
"keyword": "15e4158164f9309c75c0f97169e0026b13a642ed",
}),
("http://seiga.nicovideo.jp/user/illust/79433", {
"url": "da39a3ee5e6b4b0d3255bfef95601890afd80709",

@ -56,15 +56,15 @@ class Job():
log.error("HTTP request failed:\n%s", exc)
except exception.StopExtraction:
pass
except OSError as exc:
log.error("Unable to download data: %s", exc)
except Exception as exc:
msg = "An unexpected error occurred:"
try:
err = ": ".join(exc.args[0].reason.args[0].split(": ")[1:])
log.error("%s: %s - %s", msg, exc.__class__.__name__, err)
return
except Exception:
pass
log.error(msg, exc_info=True)
log.error(("An unexpected error occurred: %s - %s. "
"Please run gallery-dl again with the --verbose flag, "
"copy its output and report this issue on "
"https://github.com/mikf/gallery-dl/issues ."),
exc.__class__.__name__, exc)
log.debug("Traceback", exc_info=True)
def dispatch(self, msg):
"""Call the appropriate message handler"""

Loading…
Cancel
Save