code: def _store_lasterr(self):
          
          from sys import exc_info
          from traceback import format_exception
          e = exc_info()
          self.lasterr = '\n'.join(format_exception(e[0], e[1], e[2]))
docs: Stores the information about the last unhandled exception.