Support for from index greater than the actual array size during pagination

This issue is archived. You can view it, but you can't modify it. Learn more

XMLWordPrintable

      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:
      http://server/api/json?tree=jobs[name,url,builds[number,url]]

      {11000,12000}

      which throws the following exception:
      Caused by: java.lang.IllegalArgumentException: fromIndex(11000) > toIndex(10841)

            Assignee:
            Unassigned
            Reporter:
            Pratith Kanagaraj
            Archiver:
            Jenkins Service Account

              Created:
              Updated:
              Archived: