mirror of
https://github.com/Lomanic/fuz-spaceapi
synced 2025-12-14 16:36:34 +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 changed files with 1 additions and 0 deletions
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…
Add table
Reference in a new issue