code: def exceptionCaught(self, exc=None, **kwargs):
          'Maintain list of most recent errors and return most recent one.'
          if isinstance(exc, ExpectedException):  # already reported, don't log
              return
          self.lastErrors.append(stacktrace())
          if kwargs.get('status', True):
              status(self.lastErrors[-1][-1], priority=2)  # last line of latest error
          if options.debug:
              raisf exceptionCaught(self, exc=None, **kwargs):
          'Maintain list of most recent errors and return most recent one.'
          if isinstance(exc, ExpectedException):  # already reported, don't log
              return
          self.lastErrors.append(stacktrace())
          if kwargs.get('status', True):
              status(self.lastErrors[-1][-1], priority=2)  # last line of latest error
          if options.debug:
              raise
docs: Maintain list of most recent errors and return most recent one.