mirror of
https://github.com/jwilsson/spotify-web-api-php.git
synced 2026-04-26 23:45:49 +03:00
[GH-ISSUE #176] getTrack Fatal Error with Partial Track #115
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#115
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 @thejames76 on GitHub (Nov 21, 2019).
Original GitHub issue: https://github.com/jwilsson/spotify-web-api-php/issues/176
I'm mucking about with the wrapper and found that a partial getTrack call is resulting in a Fatal Error. I was expecting a FALSE condition being returned. Is this expected?
Using a full / complete track ID returns the Track's object as expected.
To test I ran this:
$sid = $api->getTrack("fjdkfds");Fatal error: Uncaught SpotifyWebAPI\SpotifyWebAPIException: invalid id in /spotify/vendor/jwilsson/spotify-web-api-php/src/Request.php:40 Stack trace: #0 /spotify/vendor/jwilsson/spotify-web-api-php/src/Request.php(242): SpotifyWebAPI\Request->parseBody(Object(stdClass), 400) #1 /spotify/vendor/jwilsson/spotify-web-api-php/src/Request.php(121): SpotifyWebAPI\Request->send('GET', 'https://api.spo...', '', Array) #2 /spotify/vendor/jwilsson/spotify-web-api-php/src/SpotifyWebAPI.php(72): SpotifyWebAPI\Request->api('GET', '/v1/tracks/*fds...', Array, Array) #3 /spotify/vendor/jwilsson/spotify-web-api-php/src/SpotifyWebAPI.php(83): SpotifyWebAPI\SpotifyWebAPI->sendRequest('GET', '/v1/tracks/*fds...', Array, Array) #4 /spotify/vendor/jwilsson/spotify-web-api-php/src/SpotifyWebAPI.php(1278): SpotifyWebAPI\SpotifyWebAPI->sendRequest('GET', '/v1/tracks/*fds...', Array, Ar in /spotify/vendor/jwilsson/spotify-web-api-php/src/Request.php on line 40
@jwilsson commented on GitHub (Nov 22, 2019):
Hi!
Yes, that's expected because Spotify returns an error response which is then converted to a PHP exception. Nothing is currently done to differentiate between different kinds of errors.
@thejames76 commented on GitHub (Nov 22, 2019):
okay, thanks for the info. <3