code: def exception(self, s):
          
          self.error(s)
          type, value, tb = sys.exc_info()
          self.writelines(traceback.format_stack(), 1)
          self.writelines(traceback.format_tb(tb)[1:], 1)
          self.writelines(traceback.format_exception_only(type, value), 1)
docs: Write error message with traceback info.