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

.track() method crashes when the limit exceed the maximum allowed #230

Open
gordielachance opened this issue Feb 24, 2021 · 1 comment
Open

Comments

@gordielachance
Copy link

gordielachance commented Feb 24, 2021

I get an error when trying to get tracks for an album using the method #tracks() :

RSpotify::Album.find('16NqPu4ZT94LJyEV6ukiyZ')

11: from /home/bozoun/.rvm/gems/ruby-2.7.0/gems/rspotify-2.10.1/lib/rspotify/album.rb:119:in `tracks'
	10: from /home/bozoun/.rvm/gems/ruby-2.7.0/gems/rspotify-2.10.1/lib/rspotify/connection.rb:39:in `block (2 levels) in singleton class'
	 9: from /home/bozoun/.rvm/gems/ruby-2.7.0/gems/rspotify-2.10.1/lib/rspotify/connection.rb:66:in `send_request'
	 8: from /home/bozoun/.rvm/gems/ruby-2.7.0/gems/rest-client-2.0.2/lib/restclient.rb:67:in `get'
	 7: from /home/bozoun/.rvm/gems/ruby-2.7.0/gems/rest-client-2.0.2/lib/restclient/request.rb:52:in `execute'
	 6: from /home/bozoun/.rvm/gems/ruby-2.7.0/gems/rest-client-2.0.2/lib/restclient/request.rb:145:in `execute'
	 5: from /home/bozoun/.rvm/gems/ruby-2.7.0/gems/rest-client-2.0.2/lib/restclient/request.rb:715:in `transmit'
	 4: from /home/bozoun/.rvm/rubies/ruby-2.7.0/lib/ruby/2.7.0/net/http.rb:933:in `start'
	 3: from /home/bozoun/.rvm/gems/ruby-2.7.0/gems/rest-client-2.0.2/lib/restclient/request.rb:725:in `block in transmit'
	 2: from /home/bozoun/.rvm/gems/ruby-2.7.0/gems/rest-client-2.0.2/lib/restclient/request.rb:809:in `process_result'
	 1: from /home/bozoun/.rvm/gems/ruby-2.7.0/gems/rest-client-2.0.2/lib/restclient/abstract_response.rb:103:in `return!'
/home/bozoun/.rvm/gems/ruby-2.7.0/gems/rest-client-2.0.2/lib/restclient/abstract_response.rb:223:in `exception_with_response': 400 Bad Request (RestClient::BadRequest)

@gordielachance
Copy link
Author

I found out.
I was using

album.tracks(limit:100)

while albums only support 50 tracks as a limit.
Maybe an error should be fired to handle this better.

Thanks for your amazing work !

@gordielachance gordielachance changed the title 400 Bad Request when trying to get an album by ID .track() method crashes when the limit exceed the maximum allowed Mar 3, 2021
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

1 participant