Fork me on GitHub
#aws
<
2020-01-29
>
ghadi21:01:30

@kenny I got bit by an AWS paginator today

ghadi21:01:35

I received :PaginationToken ""

ghadi21:01:01

at the end of a series of API calls

ghadi21:01:12

(for the resourcegroupstaggingapi)

kenny21:01:41

Oh shoot. I've hit that before too and thought we had a check for that. Just looked and it's not there anymore! The original page following code I wrote definitely checked for that. A month or so ago I rewrote it so it could follow pages from any source and I left that str/blank? check out! Ahh. Does that api consistently return "" for the pagination token when there are no more next pages?

ghadi21:01:10

depends on the API

ghadi21:01:17

that one does

ghadi21:01:32

other APIs seem to omit the key entirely

kenny21:01:08

Have you seen an api that does both -- sometimes blank and sometimes omitted?

ghadi21:01:58

haven't looked

kenny21:01:10

That might've been what happened to us last week. Same code has been running since then and has not hit that issue. Thanks for that info though! Just added the str/blank? check back in. I'm sure that will save some time in the future 🙂