zmb3 / spotify

A Go wrapper for the Spotify Web API
Apache License 2.0
1.33k stars 283 forks source link

[Fix #182] Test success before retrying request #213

Closed rtrox closed 1 year ago

rtrox commented 1 year ago

Fixes #182

In #183 concern was raised that removing 202 responses from shouldRetry might lead to breakage elsewhere. This PR takes a slightly different approach, and instead just checking isFailure to determine if we have the status we're looking for before deciding if we should retry the request.

Signed-off-by: Russell Troxel russelltroxel@gmail.com