mirror of
https://github.com/Lomanic/fuz-spaceapi
synced 2024-11-24 09:07:31 +00:00
Add error message in HTTP response when spaceapi fails to request backend API
This commit is contained in:
parent
2369064908
commit
3bf0baba8a
1
main.go
1
main.go
@ -90,6 +90,7 @@ func rootHandler(w http.ResponseWriter, r *http.Request) {
|
|||||||
resp, err := http.Get(config.PRESENCEAPI)
|
resp, err := http.Get(config.PRESENCEAPI)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
w.WriteHeader(http.StatusServiceUnavailable)
|
w.WriteHeader(http.StatusServiceUnavailable)
|
||||||
|
fmt.Fprintf(w, "err: unable to request presence API: %v", err)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
defer resp.Body.Close()
|
defer resp.Body.Close()
|
||||||
|
Loading…
Reference in New Issue
Block a user