Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error Handling Throws New Error #42

Closed
syclone opened this issue Nov 28, 2022 · 3 comments
Closed

Error Handling Throws New Error #42

syclone opened this issue Nov 28, 2022 · 3 comments

Comments

@syclone
Copy link

syclone commented Nov 28, 2022

Errors are not being handled correctly. When an error occurs with the API, this package creates another error instead of logging or presenting the API error.

ErrorException: Attempt to read property "error" on null in /var/www/html/vendor/aerni/laravel-spotify/src/SpotifyRequest.php:40

We don't know what Spotify API complained about, as the error was not handled.

Thanks for sharing this package.

@aerni
Copy link
Owner

aerni commented Nov 28, 2022

Does PR #41 resolve your issue? I'm happy to merge the changes if you confirm that it resolves your problem.

@syclone
Copy link
Author

syclone commented Nov 29, 2022

Maybe... I am going to test it and let you know soon.

@syclone
Copy link
Author

syclone commented Nov 29, 2022

Hello @aerni ,

Yes, that PR #41 fixed my issue. I am now getting the Spotify API error message instead of the "property error on null".

For example, now I see :

Too Many Requests {"exception":"[object] (Aerni\\Spotify\\Exceptions\\SpotifyApiException(code: 429): Too Many Requests at /var/www/html/vendor/aerni/laravel-spotify/src/SpotifyRequest.php:43)
[stacktrace]

Which I expected since I tried to hit my throttle limit.

I will be updating my version as soon as you merge it. Thanks

@aerni aerni mentioned this issue Nov 30, 2022
@aerni aerni closed this as completed Nov 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants