Skip to content
This repository was archived by the owner on Sep 6, 2025. It is now read-only.

Commit 0dc031c

Browse files
committed
return http status 0 as this is actually not a server error
1 parent 35c3158 commit 0dc031c

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

pkg/zappr/client.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,9 @@ func (c *clientImpl) doRequest(req *http.Request) (int, *zapprErrorResponse, err
145145
resp, err := c.slingClient.Do(req, nil, zapprErrorResponse)
146146

147147
if resp == nil {
148-
return http.StatusInternalServerError, nil, errwrap.Wrap(ErrZapprServerError, err)
148+
// Even though 0 does not seem like a valid http response code
149+
// The status would be ignored by any calling code anyway since a non-nil error is returned
150+
return 0, nil, errwrap.Wrap(ErrZapprServerError, err)
149151
}
150152

151153
if resp.StatusCode == http.StatusUnauthorized {

0 commit comments

Comments
 (0)