Skip to content

Commit 338cc8c

Browse files
feat: add debug logging for HTTP response status codes
When running in debug mode, log the HTTP response status code for all API requests. This helps diagnose issues like 413 (Request Entity Too Large) errors that previously appeared as silent failures. Co-Authored-By: Ramon Niebla <rniebla@launchdarkly.com>
1 parent e7120e8 commit 338cc8c

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

internal/ld/ld.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -485,6 +485,8 @@ func (c ApiClient) do(req *h.Request) (*http.Response, error) {
485485
return nil, err
486486
}
487487

488+
log.Debug.Printf("response status %d %s for %s %s", res.StatusCode, http.StatusText(res.StatusCode), req.Method, req.URL)
489+
488490
// Check for all general status codes returned by the code references API, attempting to deconstruct LD error messages, if possible.
489491
switch res.StatusCode {
490492
case http.StatusOK, http.StatusCreated, http.StatusNoContent:

0 commit comments

Comments
 (0)