Skip to content

Commit

Permalink
log request retries
Browse files Browse the repository at this point in the history
  • Loading branch information
maxlaverse committed Oct 1, 2024
1 parent 9b3cb01 commit 4e7ea32
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion internal/bitwarden/webapi/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,15 @@ func NewClient(serverURL string, opts ...Options) Client {
o(c)
}
c.httpClient.Logger = nil

c.httpClient.CheckRetry = CustomRetryPolicy
return c
}

func CustomRetryPolicy(ctx context.Context, resp *http.Response, err error) (bool, error) {
tflog.Trace(ctx, "retry_handler", map[string]interface{}{"status_code": resp.StatusCode, "status_message": resp.Status, "error": err})
return retryablehttp.DefaultRetryPolicy(ctx, resp, err)
}

type client struct {
deviceIdentifier string
deviceName string
Expand Down

0 comments on commit 4e7ea32

Please sign in to comment.