mallocator/Elasticsearch-Exporter

this logic seems like it would never be called

Closed this issue · 3 comments

Line 471 of "es.js"

if (result.statusCode < 200 && result.statusCode > 299)

It would never be possible to be less than 200 and be greater than 299

So the list of valid http responses goes from 100 to 599. Considering especially that there could be proxies, load balancer and what not between the tool and the server, I would say any status could come up.

For reference look here: http://en.wikipedia.org/wiki/List_of_HTTP_status_codes

Anyways, not sure what your question is?

I meant to point out the "&&" is a logical AND, which means this code block would never be called.
Just happened to be looking at that code and it stuck out is all.

( x < 200 && x > 299) will always be false since a value can't be less than 200 and also be greater than 299.

Yes, you're absolutely right. Thanks for pointing that out, I didn't quite look at the code logic, but only at the status codes.