diff --git a/hirezapi/connection.go b/hirezapi/connection.go index 5bd29f4..f567358 100644 --- a/hirezapi/connection.go +++ b/hirezapi/connection.go @@ -13,9 +13,12 @@ import ( func (a *APIClient) Ping() error { url := fmt.Sprintf("%s/%s%s", a.BasePath, "ping", a.RespType) resp, err := http.Get(url) - if resp.StatusCode != http.StatusOK { + if err != nil { return err } + if resp.StatusCode != http.StatusOK { + return fmt.Errorf("error: Ping() did not return status 200: %d, Response: %s", resp.StatusCode, resp.Body) + } return nil }