Add more info to logged message

This commit is contained in:
Svilen Markov 2025-03-16 01:25:13 +00:00
parent 047d13afd1
commit fbcea12786

View File

@ -644,7 +644,10 @@ func fetchPiholeSessionID(instanceURL string, client *http.Client, password stri
} }
if jsonResponse.Session.SID == "" { if jsonResponse.Session.SID == "" {
return "", errors.New("authentication response returned empty session ID") return "", fmt.Errorf(
"authentication response returned empty session ID, status code %d, message '%s'",
response.StatusCode, jsonResponse.Session.Message,
)
} }
return jsonResponse.Session.SID, nil return jsonResponse.Session.SID, nil