Add error message in HTTP response when spaceapi fails to request backend API

This commit is contained in:
Lomanic 2020-12-15 21:15:09 +02:00
parent 2369064908
commit 3bf0baba8a
1 changed files with 1 additions and 0 deletions

View File

@ -90,6 +90,7 @@ func rootHandler(w http.ResponseWriter, r *http.Request) {
resp, err := http.Get(config.PRESENCEAPI)
if err != nil {
w.WriteHeader(http.StatusServiceUnavailable)
fmt.Fprintf(w, "err: unable to request presence API: %v", err)
return
}
defer resp.Body.Close()