add exception name and traceback for OSErrors

This commit is contained in:
Mike Fährmann
2018-12-04 19:24:50 +01:00
parent ad2cefda6b
commit 0225d90078

View File

@@ -75,14 +75,16 @@ class Job():
except exception.StopExtraction: except exception.StopExtraction:
pass pass
except OSError as exc: except OSError as exc:
log.error("Unable to download data: %s", exc) log.error("Unable to download data: %s: %s",
exc.__class__.__name__, exc)
log.debug("", exc_info=True)
except Exception as exc: except Exception as exc:
log.error(("An unexpected error occurred: %s - %s. " log.error(("An unexpected error occurred: %s - %s. "
"Please run gallery-dl again with the --verbose flag, " "Please run gallery-dl again with the --verbose flag, "
"copy its output and report this issue on " "copy its output and report this issue on "
"https://github.com/mikf/gallery-dl/issues ."), "https://github.com/mikf/gallery-dl/issues ."),
exc.__class__.__name__, exc) exc.__class__.__name__, exc)
log.debug("Traceback", exc_info=True) log.debug("", exc_info=True)
self.handle_finalize() self.handle_finalize()
def dispatch(self, msg): def dispatch(self, msg):