Handle watch order response close errors

This commit is contained in:
2026-06-20 18:29:04 +02:00
committed by Milas Holsting
parent 0acefe636e
commit 1c24dc221f

View File

@@ -6,6 +6,7 @@ import (
"errors" "errors"
"fmt" "fmt"
"io" "io"
"mal/pkg/errlog"
netutil "mal/pkg/net" netutil "mal/pkg/net"
"net/http" "net/http"
"regexp" "regexp"
@@ -205,7 +206,9 @@ func fetchProxyText(ctx context.Context, httpClient *http.Client, url string) (s
if err != nil { if err != nil {
return "", fmt.Errorf("proxy request failed: %w", err) return "", fmt.Errorf("proxy request failed: %w", err)
} }
defer func() { _ = response.Body.Close() }() defer func() {
errlog.Log("failed to close watch order proxy response body", response.Body.Close())
}()
if response.StatusCode != http.StatusOK { if response.StatusCode != http.StatusOK {
return "", fmt.Errorf("proxy status %d", response.StatusCode) return "", fmt.Errorf("proxy status %d", response.StatusCode)