code: def close(self, exception=None):
          
          self.running = False
          if self.error:
              return
          if isinstance(exception, errors.LinkRedirect):
              self.redirected = exception
          elif isinstance(exception, EventHubError):
              self.error = exception
          elif exception:
              self.error = EventHubError(str(exception))
          else:
              self.error = EventHubError("This send handler is now closed.")
          self._handler.close()
docs: Close down the handler. If the handler has already closed,
          this will be a no op. An optional exception can be passed in to
          indicate that the handler was shutdown due to error.
  
          :param exception: An optional exception if the handler is closing
           due to an error.
          :type exception: Exception