Skip to content

Commit a1be537

Browse files
feat: add debug logging for HTTP response status codes (#587)
## Summary Adds debug logging for HTTP response status codes in the API client's `do` method. When running with `--debug` enabled, all API responses will now log their status code, status text, HTTP method, and URL. This addresses an issue where 413 (Request Entity Too Large) errors appeared as silent failures - the tool would report sending code references successfully, but nothing would appear in LaunchDarkly because the payload was rejected. Example debug output: ``` DEBUG: 2026/01/14 12:00:00 ld.go:488: response status 413 Request Entity Too Large for PUT https://app.launchdarkly.com/api/v2/code-refs/repositories/... ``` Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
1 parent e7120e8 commit a1be537

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)