You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ponymail.apache.org by sebb <se...@gmail.com> on 2016/09/25 21:50:03 UTC

Elastic.lua error handling

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.