Commit adf82612 authored by Jerome Mariette's avatar Jerome Mariette
Browse files

fix a bug with chaining traceback

parent 76c22cb1
......@@ -509,6 +509,7 @@ class Workflow(threading.Thread):
# Format str
pretty_str = title
pretty_str += ("\n" + worflow_errors) if worflow_errors != "" else ""
if len(workflow.get_components_nameid()) > 0:
pretty_str += ("\n" + status) if status != "" else ""
pretty_str += ("\n" + components_errors) if components_errors != "" else ""
if html: return pretty_str.replace("\n", "<br />")
......@@ -647,20 +648,20 @@ class Workflow(threading.Thread):
s.starttls()
s.login(me, fromp)
except smtplib.SMTPHeloError:
self._log("The server didn't reply properly to the HELO greeting.", level="debug", traceback=traceback.format_exc())
self._log("The server didn't reply properly to the HELO greeting.", level="debug", traceback=traceback.format_exc(chain=False))
except smtplib.SMTPAuthenticationError:
self._log("The server didn't accept the username/password combination.", level="debug", traceback=traceback.format_exc())
self._log("The server didn't accept the username/password combination.", level="debug", traceback=traceback.format_exc(chain=False))
except smtplib.SMTPException:
self._log("No suitable authentication method was found, or the server does not support the STARTTLS extension.", level="debug", traceback=traceback.format_exc())
self._log("No suitable authentication method was found, or the server does not support the STARTTLS extension.", level="debug", traceback=traceback.format_exc(chain=False))
except RuntimeError:
self._log("SSL/TLS support is not available to your Python interpreter.", level="debug", traceback=traceback.format_exc())
self._log("SSL/TLS support is not available to your Python interpreter.", level="debug", traceback=traceback.format_exc(chain=False))
except:
self._log("Unhandled error when sending mail.", level="debug", traceback=traceback.format_exc())
self._log("Unhandled error when sending mail.", level="debug", traceback=traceback.format_exc(chain=False))
finally:
s.sendmail(me, [you], msg.as_string())
s.close()
except:
self._log("Impossible to connect to smtp server '" + smtps + "'", level="debug", traceback=traceback.format_exc())
self._log("Impossible to connect to smtp server '" + smtps + "'", level="debug", traceback=traceback.format_exc(chain=False))
def get_parameters_per_groups(self):
name = self.get_name()
......@@ -865,7 +866,7 @@ class Workflow(threading.Thread):
self._serialize()
self._send_email()
except Exception as e:
self._log(str(e), traceback=traceback.format_exc())
self._log(str(e), traceback=traceback.format_exc(chain=False))
utils.display_error_message(str(e))
def _update_status_from_log(self):
......@@ -1068,7 +1069,7 @@ class Workflow(threading.Thread):
if issubclass(obj, jflow.component.Component) and obj.__name__ != jflow.component.Component.__name__:
pckge[class_name] = modname
except Exception as e:
self._log("Component <{0}> cannot be loaded: {1}".format(modname, e), level="debug", traceback=traceback.format_exc())
self._log("Component <{0}> cannot be loaded: {1}".format(modname, e), level="debug", traceback=traceback.format_exc(chain=False))
# finally import workflows shared packages
workflows_dir = os.path.dirname(os.path.dirname(inspect.getfile(self.__class__)))
for importer, modname, ispkg in pkgutil.iter_modules([os.path.join(workflows_dir, "components")], "workflows.components."):
......@@ -1078,7 +1079,7 @@ class Workflow(threading.Thread):
if issubclass(obj, jflow.component.Component) and obj.__name__ != jflow.component.Component.__name__:
pckge[class_name] = modname
except Exception as e:
self._log("Component <{0}> cannot be loaded: {1}".format(modname, e), level="debug", traceback=traceback.format_exc())
self._log("Component <{0}> cannot be loaded: {1}".format(modname, e), level="debug", traceback=traceback.format_exc(chain=False))
return pckge
def _import_external_components(self):
......@@ -1093,7 +1094,7 @@ class Workflow(threading.Thread):
if issubclass(obj, jflow.extparser.ExternalParser) and obj.__name__ != jflow.extparser.ExternalParser.__name__:
parsers.append(obj())
except Exception as e:
self._log("Parser <{0}> cannot be loaded: {1}".format(modname, e), level="debug", traceback=traceback.format_exc())
self._log("Parser <{0}> cannot be loaded: {1}".format(modname, e), level="debug", traceback=traceback.format_exc(chain=False))
for parser in parsers :
# import from pipeline components package ...
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment