clintongormley/ElasticSearch.pm — Issue #20: Error messages from server obscured in a wash of noise
Author: kentfredric
Created: 2011-10-25 02:12:08+00:00
State: open

If you take a look at this example code and the output of it, ( https://gist.github.com/1311086 ) you sort of get the impression the server is telling you "YOU DUN GOOFED" and little more.

Took me a long time to realise there was actually some useful context hiding in there telling me the servers actual message it was reporting the error with.

I refactored it to this ( with a lot of probing around and dumping things to discover hidden private variables ... )

https://gist.github.com/1311103

And this was literally 1000x useful to me ( at least when wrapped in my terminal ), as there was no massive bombardment of back-slash escaping obscuring the servers response, and the actual error being hidden between 2 sets of equally nasty escapings.

It then revealed :

QueryParsingException[[cpan_v3] Type [module] does not have parent mapping] <-- this gem.

While It may not appear useful, it means I can stop poking around with has_child and instead try some other less-broken approach.

And much could be done to improve the clarity of the server reponse error ( a few line feeds please? )

Apologies if this bug report seems a little caustic, I've had a bad day so far fighting with an ES server :(