kill request if there are no [more] available translation samples #3
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.
Ой, братишка! Greetings from Brazil. Your API has been of great use to me. I'm using it to create material to study Russian on Anki. There was a little problem where if you made a request for translation samples for an entry that is not available on Reverso Context it would never stop doing the request, and then the server would inevitably throw a 429 exception (and if this kept happening your IP would be temporarily blocked from making requests, which is awful). Same thing would happen if you asked for a number of samples for a given word, but the number of available samples on Reverso Context for that word is smaller than the number you requested.
Anyway, my solution is not the most elegant but I think it solves the problem.