Replies: 4 comments
-
I honestly don't think rate limiting is something rspotify itself should handle. If your client gets one of these, just wait for the indicated amount of time and retry again. |
Beta Was this translation helpful? Give feedback.
-
In that case why isn't there any helper method or error type which would contain the |
Beta Was this translation helpful? Give feedback.
-
The thing is that it was quite hard to wrap all the errors under the same interface. Since we now support both ureq and reqwest, they are reported in different ways depending on what client you're using. It's certainly possible, but for the first version I chose the easiest option and just left the original error types. For now you can check reqwest/ureq's documentation and see how they handle these errors yourself. We could try to wrap the errors in the future, but I remember that it was somewhat complicated when I tried. |
Beta Was this translation helpful? Give feedback.
-
I agree with Mario's point, rspotify should be a lightweight rust wrapper for the Spotify Web API, instead of an all-in-one clumsy library. The rate limit error isn't raised from |
Beta Was this translation helpful? Give feedback.
-
Describe the bug
You can still hit the rate limit, which causes HTTP status 429.
To Reproduce
Make a loop doing single request such as search. This is kinda hard to reproduce, because it depends on your internet connection, and also luck (Spotify servers might be busy = slower = won't reach the rate limit). In our case it happened randomly after spamming the API for few hours.
Expected behavior
rspotify
shouldn't hit it, or retry in case it happens, not return an error.Log/Output data
http error: status code 429
Additional context
I don't know where the rate limit handling is implemented or how it's implemented.
Beta Was this translation helpful? Give feedback.
All reactions