Skip to content

ThrowExceptions xmldocs is misleading #3511

@octocat-mona

Description

@octocat-mona

NEST/Elasticsearch.Net version:
6.3.1

Elasticsearch version:
6.5.0

Description of the problem including expected versus actual behavior:
Apparently it was decided to not always throw in case IsValid is false (see #2153, #2385).
My issue is not to reconsider this (although it would be nice to have this functionality somehow) but rather to clarify the documentation of ThrowExceptions which states:

...always throw an exception on the client when a call resulted in an exception on either the client or the Elasticsearch server.

Because I assumed I do not have to check a response for IsValid to be false I actually introduced a bug in my code. Maybe the xmldocs can be updated to state that always is not always always? 😉

Steps to reproduce:

  1. Create new ElasticClient instance using ConnectionSettings.ThrowExceptions()
  2. Call a method like UpdateByQuery which causes an error (like a document object not passing the strict mapping validation)
  3. No exception is thrown

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions