Elastic.lua:checkReturn() currently throws an error if the http request returns anything other than 200.
However some requests (e.g. http://localhost:9200/ponymail/mbox/unknown) return a 404. This does not indicate a problem with the server, however the response is very similar. At present the only way to distiguish database errors from missing documents is to catch and parse the error. That is not very easy to do. I think the elastic.lua module should hide such details from the caller. i.e. it should only throw an error if something has gone badly wrong.
