Skip to content

armgit / ente

Public Imported from GitHub
0

πŸ’š End-to-end encrypted cloud for everything.

[cli] Log selected headers on download failure

Neeraj Gupta9a1254b745e9
diff --git a/cli/internal/api/client.go b/cli/internal/api/client.go
index 1127e6c2c2..c0b8089b42 100644
--- a/cli/internal/api/client.go
+++ b/cli/internal/api/client.go
@@ -76,7 +76,10 @@ func NewClient(p Params) *Client {
AddRetryCondition(func(r *resty.Response, err error) bool {
shouldRetry := r.StatusCode() == 429 || r.StatusCode() >= 500
if shouldRetry {
- log.Printf("retrying download due to %d code", r.StatusCode())
+ amxRequestID := r.Header().Get("X-Amz-Request-Id")
+ cfRayID := r.Header().Get("CF-Ray")
+ wasabiRefID := r.Header().Get("X-Wasabi-Cm-Reference-Id")
+ log.Printf("Retry scheduled. error statusCode: %d, X-Amz-Request-Id: %s, CF-Ray: %s, X-Wasabi-Cm-Reference-Id: %s", r.StatusCode(), amxRequestID, cfRayID, wasabiRefID)
}
return shouldRetry
}),