rinukkusu / spotify-dart

A dart library for interfacing with the Spotify API.
BSD 3-Clause "New" or "Revised" License
206 stars 92 forks source link

Throw `ArgumentError`s when `assert`ions fail #216

Open hayribakici opened 4 months ago

hayribakici commented 4 months ago

As mentioned in #215, the assert statements take only place in debug mode. Which means, when this library is compiled or run in production, the asserts are simply ignored.

So in order to provide library users a better handling of the spotify API constraints (e.g. number of tracks in a json) when this library is compiled (or in production mode) and without making unnecessary requests, all methods, that have assert statements, should be replaced with ArgumentErrors or similar.

Thanks to @artyuum for pointing this out.

hayribakici commented 4 months ago

@artyuum this looks like a good first issue. Would you like to implememt it?

artyuum commented 4 months ago

Sure, I'll give it a try.