update output logic on error

[ci skip]
This commit is contained in:
Mike Fährmann
2017-05-23 20:12:57 +02:00
parent e425243b1e
commit 30eef527d8

View File

@@ -53,13 +53,14 @@ class Job():
except exception.StopExtraction: except exception.StopExtraction:
pass pass
except Exception as exc: except Exception as exc:
msg = "An unexpected error occurred:"
try: try:
err = ": ".join(exc.args[0].reason.args[0].split(": ")[1:]) err = ": ".join(exc.args[0].reason.args[0].split(": ")[1:])
log.error("%s: %s - %s", msg, exc.__class__.__name__, err)
return
except Exception: except Exception:
err = str(exc) pass
log.error("An unexpected error occurred: %s - %s", log.error(msg, exc_info=True)
exc.__class__.__name__, err)
log.debug("Traceback", exc_info=True)
def dispatch(self, msg): def dispatch(self, msg):
"""Call the appropriate message handler""" """Call the appropriate message handler"""