Commit 1cde63dd authored by Daniel Hiltgen's avatar Daniel Hiltgen
Browse files

Log unexpected server errors checking for update

This should unmask some failure modes that likely
show up in app logs as unmarshal errors
parent a189810d
...@@ -86,6 +86,11 @@ func IsNewReleaseAvailable(ctx context.Context) (bool, UpdateResponse) { ...@@ -86,6 +86,11 @@ func IsNewReleaseAvailable(ctx context.Context) (bool, UpdateResponse) {
if err != nil { if err != nil {
slog.Warn(fmt.Sprintf("failed to read body response: %s", err)) slog.Warn(fmt.Sprintf("failed to read body response: %s", err))
} }
if resp.StatusCode != 200 {
slog.Info(fmt.Sprintf("check update error %d - %.96s", resp.StatusCode, string(body)))
return false, updateResp
}
err = json.Unmarshal(body, &updateResp) err = json.Unmarshal(body, &updateResp)
if err != nil { if err != nil {
slog.Warn(fmt.Sprintf("malformed response checking for update: %s", err)) slog.Warn(fmt.Sprintf("malformed response checking for update: %s", err))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment