Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[API] Fixed the "greedy" regex in the
Utils.__rescue_from_not_found
…
… method The previous implementation of the `Utils.__rescue_from_not_found` method matched the exception method on a pattern including `404`, which has led to incorrectly capturing eg. the `Elasticsearch::Transport::Transport::Errors::Conflict` exception, when the document version or ID contained the `404` string. This patch narrows the regex pattern to only look for the "Not Found" string, in order with the original motivation to enable this functionality also in custom clients, not based on the `elasticsearch-transport` Rubygem. It also fixes the `rescue` clause itself, to only catch exceptions descending from `StandardError`, not `Exception`. Tests have been updated accordingly. Closes #490
- Loading branch information
3533d2f
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍