In range notation during pagination, if the from index exceeds the actual array size, Jenkins throws an exception. Can't it return an empty response or something similar instead, so that we know when to stop?
For example, suppose a Jenkins server has 10840 jobs and we want to get all the jobs' details. We keep incrementing the lower bound according to page size (say 1000). Eventually, we hit:
which throws the following exception:
Caused by: java.lang.IllegalArgumentException: fromIndex(11000) > toIndex(10841)