mirror of
https://github.com/jwilsson/spotify-web-api-php.git
synced 2026-04-27 07:55:49 +03:00
[GH-ISSUE #102] An unknown error occurred. #58
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#58
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 @csimpi on GitHub (Oct 25, 2017).
Original GitHub issue: https://github.com/jwilsson/spotify-web-api-php/issues/102
Hi, thanks for this awesome API!
I got a problem and I've tried to debug it without any luck.
I have a javascript that calls a function after any 5-10 sec randomly. That function gets data from Spotify API through my PHP file that uses your library.
It works well for hundred times without any issue, then I got this error message very randomly.
I use client credentials authentication, there is some problem with that part, as I can see.
Thx, Peter
The error message:
Fatal error: Uncaught SpotifyWebAPI\SpotifyWebAPIException: An unknown error occurred. in /var/www/mochart/public/vendor/jwilsson/spotify-web-api-php/src/Request.php:44Stack trace:#0 /var/www/mochart/public/vendor/jwilsson/spotify-web-api-php/src/Request.php(222): SpotifyWebAPI\Request->parseBody(NULL, 502)#1 /var/www/mochart/public/vendor/jwilsson/spotify-web-api-php/src/Request.php(88): SpotifyWebAPI\Request->send('POST', 'https://account...', 'grant_type=clie...', Array)#2 /var/www/mochart/public/vendor/jwilsson/spotify-web-api-php/src/Session.php(168): SpotifyWebAPI\Request->account('POST', '/api/token', Array, Array)#3 /var/www/mochart/public/api.php(84): SpotifyWebAPI\Session->requestCredentialsToken()#4 /var/www/mochart/public/api.php(34): spotiAuth('guest')#5 {main} thrown in /var/www/mochart/public/vendor/jwilsson/spotify-web-api-php/src/Request.php on line 44@jwilsson commented on GitHub (Oct 27, 2017):
Hi!
It looks like Spotify is returning you a
502 Bad Gatewayserver error. I'd file an issue over at their repo and wrap your call toSession->requestCredentialsToken()in atry/catchwhere you retry the request and prevents it from crashing completely.@jwilsson commented on GitHub (Nov 3, 2017):
Closing this since I'm pretty sure it's an issue on Spotify's end. Just give me a shout if you want it reopened!