def handle_auth_failure!
      yield
    rescue Mongo::Error::SocketTimeoutError
      # possibly cluster is slow, do not give up on it
      raise
    rescue Mongo::Error::SocketError
      # non-timeout network error
      unknown!
      pool.disconnect!
      raise
    rescue Auth::Unauthorized
      # auth error, keep server description and topology as they are
      pool.disconnect!
      raise
    end
def handle_auth_failure!
      yield
    rescue Mongo::Error::SocketTimeoutError
      # possibly cluster is slow, do not give up on it
      raise
    rescue Mongo::Error::SocketError
      # non-timeout network error
      unknown!
      pool.disconnect!
      raise
    rescue Auth::Unauthorized
      # auth error, keep server description and topology as they are
      pool.disconnect!
      raise
    end
Handle authentication failure.

 @example Handle possible authentication failure.
   server.handle_auth_failure! do
     Auth.get(user).login(self)
   end

 @raise [ Auth::Unauthorized ] If the authentication failed.

 @return [ Object ] The result of the block execution.

 @since 2.3.0