ANONYMOUS wrote:
Hi, I just started task 8 and noticed how much larger the workload is compared to the previous tasks, which is quite overwhelming.
I'm very lost on how to approach this task. I understand that next() function must check a page and move on if the page is out of students, however I can't wrap my head around how the retries is working alongside it. Would it be possible to get a good explanation about this?
As I understand your question here, all the information you require is in the project instructions and the documentation comments to which they refer. Please read them carefully again, and if you are still confused, please reply to this thread with more detail as to what it is you are confused about so I can try to help you.
At the moment my next() runs hasNext first and returns the usual NoSuchElementException()
However, this Task introduces two new errors: QueryTimedOutException and ApiUnreachableException
Does ApiUnreachableException replace NoSuchElementException???
And is QueryTimedOutException to go alongside the retries when we call get page?
No, ApiUnreachableException
does not replace NoSuchElementException
. NoSuchElementException
should be thrown when attempting to call next()
on an iterator that has no remaining elements to give. Per the documentation, an ApiUnreachableException
should be thrown when you have attempted to call getPage()
on the API, but have not been able to get a response even after trying as many times as specified by the retry quota, and so are unable to reach the API.
All this information is in the provided materials, as mentioned above, so I am not sure if this is your confusion. Let me know if it's something else.
I will also mention that the tests check for the expected behaviour here, so if you get it wrong (at least in the obvious ways like using the wrong exception) the tests should make that clear.