For some time now, (i suspect related to T299521) lots of indexes have an ugly and discouraging error instead of a pagelist (example as 15/04/24)
This is solved via ?action=purge'ing the local file description page.
The thing is, I want to be able to track said errors and purge the pages, and add a link so people can help by manually purging the page instead of frustrating and leaving the site forever (a normal person reaction to this absurd issue)
So, In our local index template I tried to wrap the pagelist into an #iferror tag, but the tag doesn't detect the error, even though the result clearly has the element with class="error" within.
You can see the issue live in the index page linked above.