Replace runtime ToManyStations error with compile time check #18
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This change was done to prevent runtime errors if the user tried to fetch prices for more than 10 stations at once. Due to a limitation of the tankerkoenig API it's not possible to request more than 10 stations at once.
To ensure this behavior already at compile time, the fetch station prices function now accepts only an array with up to 10 entries instead a vector with unknown size.
This comes at costs to the usability, as you now have to wrap the ids in the array to options, but on the other side it is less likely to cause runtime errors.