[.NET SDK v7] IsValid vs ThrowExceptions and bulk

The docs say:

By default, the client won’t throw on any ElasticsearchClientException but instead return an invalid response that can be detected by checking the .IsValid property on the response. You can change this behaviour with by using ThrowExceptions() on ConnectionSettings.

How to interpret this? I'd think that enabling ThrowExceptions() on the connection should always throw an exception when IsValid would be false. However, I noticed that this call: await _client.BulkAsync(descriptor, cancellationToken); does not throw even if it does not succeed (e.g. due to missing index in elasticsearch). The response has IsValid equal to false

What is the actual relationship between IsValid and the ThrowExceptions() setting?

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.