ddnexus / flex

The ultimate ruby client for elasticsearch.
http://ddnexus.github.io/flex/doc/
72 stars 15 forks source link

How to best rescue from #30

Open AlanMcCann opened 9 years ago

AlanMcCann commented 9 years ago

I'm trying to figure out how to rescue from a Flex::HttpError 404 404: {"found":false error. when attempting to delete an item from the index that doesn't exist. It is an edge case where a deleted active record entry isn't removed from the index but I need to handle it at this point.

I would prefer that Flex handled this differently but I can understand the approach.

I just don't know how to rescue/recover - where to put the rescue code.

ddnexus commented 9 years ago

If you just don't want to raise the error, add :raise => false to the variables... does that help?