ElasticHQ / elasticsearch-HQ

Monitoring and Management Web Application for ElasticSearch instances and clusters.
http://www.elastichq.org
Other
4.96k stars 532 forks source link

minor fix for cases where esHQ does not have internet connection... #478

Closed toravir closed 5 years ago

toravir commented 5 years ago

When ElasticHQ website cannot be reached, application.py does not respond to

GET /api/status

This diff will make it return this reponse:

{"data": [{"name": "ElasticHQ", "installed_version": "3.5.0", "current_stable_version": "Err: unable to reach elastichq.org", ...}

Without this diff - application.py will hit a backtrace like this:

  File "/usr/local/lib/python3.6/json/decoder.py", line 357, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)