Skip to content

Conversation

@mlangenberg
Copy link
Contributor

Currently there is an error in the documentation:

The highest-level exception is {Elasticsearch::Transport::Transport::Error} and will be raised for any generic client or server errors.

This is not true, because Transport::ServerError inherits from StandardError. If you rescue Elasticsearch::Transport::Transport::Error, you would actually miss all exceptions such as NotFound or ServiceUnavailable.

Behavior is now in line with documentation.

Added test may be ditched, it's a very trivial change and testing the exception hierarchy chain doesn't make much sense.

Allow rescuing raised Errors::NotFound or Errors::ServerError by rescue
Transport::Error.

Behavior is now in line with documentation: “The highest-level
exception is {Elasticsearch::Transport::Transport::Error} and will be
raised for any generic client or server errors.”
@karmi
Copy link
Contributor

karmi commented Oct 1, 2014

Thanks!, @mlangenberg, good catch. Can you please sign the CLA so I can merge this?

@mlangenberg
Copy link
Contributor Author

Sure. Just signed the CLA.

@karmi karmi closed this in 0149954 Oct 2, 2014
@karmi
Copy link
Contributor

karmi commented Oct 2, 2014

Thanks!, merged and pushed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants