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
This commit is contained in:
Mike Fährmann
2017-08-10 16:29:05 +02:00
parent 7e936e9c06
commit cfa479fab5
3 changed files with 9 additions and 11 deletions

View File

@@ -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"""