mirror of
https://github.com/jwilsson/spotify-web-api-php.git
synced 2026-04-27 07:55:49 +03:00
[GH-ISSUE #58] How to catch a 429 and get the Retry-after? #32
Labels
No labels
bug
docs
enhancement
enhancement
enhancement
feedback wanted
good first issue
help wanted
help wanted
help wanted
invalid
pull-request
question
question
upstream
upstream
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/spotify-web-api-php#32
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @Defcon0 on GitHub (Nov 19, 2016).
Original GitHub issue: https://github.com/jwilsson/spotify-web-api-php/issues/58
Hello,
thanks for your great plugin. I'm currently testing it and one question comes to my mind:
As you of course know, there's a rate limit to spotify api. When it's reached, you get a http error code 429 and a Retry After header.
Is there any way to catch that information from your library? Is it saved to the "code" field in a SpotifyWebApiException and all I have to do is catch this Exception?
Bye Defcon0
@andig commented on GitHub (Nov 19, 2016):
See https://github.com/andig/spotify-web-api-extensions for an extension that handles rate limiting.
@Defcon0 commented on GitHub (Nov 19, 2016):
Thanks for the advice
@jwilsson commented on GitHub (Nov 19, 2016):
Hi @Defcon0,
An exception with a code of
429will be thrown and @andig's extension contains some great pointers.Cheers!