Stringify error message in ping endpoint

This commit is contained in:
Tulir Asokan 2021-01-28 22:46:57 +02:00
parent 95f6487912
commit 25cca87959

View file

@ -262,9 +262,13 @@ func (prov *ProvisioningAPI) Ping(w http.ResponseWriter, r *http.Request) {
"is_login_in_progress": user.Conn.IsLoginInProgress(), "is_login_in_progress": user.Conn.IsLoginInProgress(),
} }
err := user.Conn.AdminTest() err := user.Conn.AdminTest()
var errStr string
if err != nil {
errStr = err.Error()
}
wa["ping"] = map[string]interface{}{ wa["ping"] = map[string]interface{}{
"ok": err == nil, "ok": err == nil,
"err": err, "err": errStr,
} }
} }
resp := map[string]interface{}{ resp := map[string]interface{}{