Esempio n. 1
0
File: Log.py Progetto: ommaurya/csm
 def aborted(self, exc_info):
     """
     Called by a logger to log an exception.
     """
     self.exc_info = exc_info
     self.did_end = True
     self.write(format_exception(*self.exc_info))
Esempio n. 2
0
 def _on_job_error(self, job, exc_info):
     msg = "{}: {} error: {}".format(self.task.name, job.name, str(exc_info[1]))
     trace = "".join(format_exception(*exc_info))
     self._print("errors", msg)
     if _is_recoverable_error(exc_info[0]):
         self._print("tracebacks", trace)
     else:
         self._print("fatal_errors", trace)
Esempio n. 3
0
File: Log.py Progetto: ommaurya/csm
 def get_error(self, include_tb=True):
     if self.exc_info is None:
         return None
     if include_tb:
         return format_exception(*self.exc_info)
     if str(self.exc_info[1]):
         return str(self.exc_info[1])
     return self.exc_info[0].__name__
Esempio n. 4
0
 def _on_job_error(self, job, exc_info):
     msg = "{}: {} error: {}".format(self.task.name, job.name,
                                     str(exc_info[1]))
     trace = ''.join(format_exception(*exc_info))
     self._print('errors', msg)
     if _is_recoverable_error(exc_info[0]):
         self._print('tracebacks', trace)
     else:
         self._print('fatal_errors', trace)
Esempio n. 5
0
 def aborted(self, exc_info):
     self.exc_info = exc_info
     self.did_end = True
     self.write('ERROR:', str(exc_info[1]), '\n')
     self._write_error(format_exception(*self.exc_info))