Skip to content

Commit 7c93a66

Browse files
committed
Update logger variable name in http_error_handling.go
1 parent 0d8e4d0 commit 7c93a66

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

internal/httpclient/http_error_handling.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ func (c *Client) HandleAPIError(resp *http.Response) error {
3030
err := json.NewDecoder(resp.Body).Decode(&structuredErr)
3131
if err == nil && structuredErr.Error.Message != "" {
3232
// Using structured logging to log the structured error details
33-
c.logger.Warn("API returned structured error",
33+
c.Logger.Warn("API returned structured error",
3434
zap.String("status", resp.Status),
3535
zap.String("error_code", structuredErr.Error.Code),
3636
zap.String("error_message", structuredErr.Error.Message),
@@ -46,13 +46,13 @@ func (c *Client) HandleAPIError(resp *http.Response) error {
4646
if err != nil || errMsg == "" {
4747
errMsg = fmt.Sprintf("Unexpected error with status code: %d", resp.StatusCode)
4848
// Logging with structured fields
49-
c.logger.Warn("Failed to decode API error message, using default error message",
49+
c.Logger.Warn("Failed to decode API error message, using default error message",
5050
zap.String("status", resp.Status),
5151
zap.String("error_message", errMsg),
5252
)
5353
} else {
5454
// Logging non-structured error as a warning with structured fields
55-
c.logger.Warn("API returned non-structured error",
55+
c.Logger.Warn("API returned non-structured error",
5656
zap.String("status", resp.Status),
5757
zap.String("error_message", errMsg),
5858
)

0 commit comments

Comments
 (0)