Handle watch order response close errors
This commit is contained in:
@@ -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)
|
||||||
|
|||||||
Reference in New Issue
Block a user