elasticsearch/elasticsearch-ruby — pull request #61 by mschulkind (2014-04-26 05:03:30+00:00)
Title: Catch more Faraday request errors.

I was having trouble connecting to an elasticsearch instance in my production environment, and I finally realized that it was because I was using a self-signed certificate in front of elasticsearch. To my surprise, there was no real error reported, just a vague `NoMethodError: undefined method `[]' for nil:NilClass`.

This was because this gem doesn't check for all Faraday errors. I made the check more accurate, and also added a bit to the error exception, because at least for SSL certificate verification failures using Typhoeus, the response comes back with an empty body and status 0, so the entire exception message was `[0]` which I figured is just a little too vague.