code: def capture_exception(self, error=None):
          # type: (Optional[BaseException]) -> Optional[str]
          
          client = self.client
          if client is None:
              return None
          if error is None:
              exc_info = sys.exc_info()
          else:
              exc_info = exc_info_from_error(error)
  
          event, hint = event_from_exception(exc_info, client_options=client.options)
          try:
              return self.capture_event(event, hint=hint)
          except Exception:
              self._capture_internal_exception(sys.exc_info())
  
          return None
docs: Captures an exception.
  
          The argument passed can be `None` in which case the last exception
          will be reported, otherwise an exception object or an `exc_info`
          tuple.