code: def safe_repr(source, max_length=0):
      
      try:
          return ellipsis(repr(source), max_length)
      except Exception as e:
          return ellipsis("<n/a: repr(...) raised %s>" % e, max_length)
docs: Wrapper for repr() that catches exceptions.