Subject: | retrieve_paged infinite loop |
retrieve_paged can get into an infinite loop if the response is valid
but has 0 results (an easy condition to create by setting the filter to
a value that never occurs). In this case totalResults is 0 but
itemsPerPage is non-zero so the loop never terminates.
Also, there is no checking of $page->is_success, so a failure (such as a
Forbidden response due to the specified GA profile ID not being
available to the authorised user) causes a hard-to-interpret error later
in the code.
Regards,
Jon Schutz
http://notes.jschutz.net/