def test_unexpectedError(self):
     """The puller master logs an OOPS when it receives an unexpected
     error.
     """
     fail = makeFailure(RuntimeError, 'error message')
     self.eventHandler.unexpectedError(fail)
     oops = self.oopses[-1]
     self.assertEqual(fail.getTraceback(), oops['tb_text'])
     self.assertEqual('error message', oops['value'])
     self.assertEqual('RuntimeError', oops['type'])
     self.assertEqual(
         get_canonical_url_for_branch_name(
             self.eventHandler.unique_name), oops['url'])
Exemple #2
0
 def test_unexpectedError(self):
     """The puller master logs an OOPS when it receives an unexpected
     error.
     """
     fail = makeFailure(RuntimeError, 'error message')
     self.eventHandler.unexpectedError(fail)
     oops = self.oopses[-1]
     self.assertEqual(fail.getTraceback(), oops['tb_text'])
     self.assertEqual('error message', oops['value'])
     self.assertEqual('RuntimeError', oops['type'])
     self.assertEqual(
         get_canonical_url_for_branch_name(
             self.eventHandler.unique_name), oops['url'])
 def unexpectedError(self, failure):
     request = errorlog.ScriptRequest([('branch_id', self.branch_id),
                                       ('source', self.source_url),
                                       ('dest', self.destination_url),
                                       ('error-explanation',
                                        failure.getErrorMessage())])
     request.URL = get_canonical_url_for_branch_name(self.unique_name)
     # If the sub-process exited abnormally, the stderr it produced is
     # probably a much more interesting traceback than the one attached to
     # the Failure we've been passed.
     tb = None
     if failure.check(error.ProcessTerminated, UnexpectedStderr):
         tb = getattr(failure, 'error', None)
     if tb is None:
         tb = failure.getTraceback()
     errorlog.globalErrorUtility.raising((failure.type, failure.value, tb),
                                         request)
     self.logger.info('Recorded %s', request.oopsid)
 def unexpectedError(self, failure):
     request = errorlog.ScriptRequest([
         ('branch_id', self.branch_id),
         ('source', self.source_url),
         ('dest', self.destination_url),
         ('error-explanation', failure.getErrorMessage())])
     request.URL = get_canonical_url_for_branch_name(self.unique_name)
     # If the sub-process exited abnormally, the stderr it produced is
     # probably a much more interesting traceback than the one attached to
     # the Failure we've been passed.
     tb = None
     if failure.check(error.ProcessTerminated, UnexpectedStderr):
         tb = getattr(failure, 'error', None)
     if tb is None:
         tb = failure.getTraceback()
     errorlog.globalErrorUtility.raising(
         (failure.type, failure.value, tb), request)
     self.logger.info('Recorded %s', request.oopsid)